Newer
Older
Gigg, Martyn Anthony
committed
//
// Wrappers for classes in the Mantid::API namespace
//
Gigg, Martyn Anthony
committed
#include <MantidPythonAPI/api_exports.h>
#include <MantidPythonAPI/stl_proxies.h>
Gigg, Martyn Anthony
committed
#include <MantidPythonAPI/WorkspaceProxies.h>
Gigg, Martyn Anthony
committed
#include <string>
Gigg, Martyn Anthony
committed
#include <ostream>
Gigg, Martyn Anthony
committed
// API
#include <MantidAPI/ITableWorkspace.h>
#include <MantidAPI/WorkspaceGroup.h>
#include <MantidAPI/Instrument.h>
#include <MantidAPI/ParInstrument.h>
#include <MantidAPI/Sample.h>
Gigg, Martyn Anthony
committed
#include <MantidAPI/WorkspaceProperty.h>
Gigg, Martyn Anthony
committed
#include <MantidAPI/FileProperty.h>
#include <MantidAPI/WorkspaceValidators.h>
#include <MantidAPI/FileFinder.h>
#include <MantidPythonAPI/PyAlgorithmWrapper.h>
Gigg, Martyn Anthony
committed
namespace Mantid
{
namespace PythonAPI
{
using namespace Mantid::API;
using namespace boost::python;
Gigg, Martyn Anthony
committed
//@cond
Gigg, Martyn Anthony
committed
//---------------------------------------------------------------------------
// Class export functions
//---------------------------------------------------------------------------
void export_frameworkmanager()
{
/**
Gigg, Martyn Anthony
committed
* Python Framework class (note that this is not the Mantid::API::FrameworkManager, there is another in
* PythonAPI::FrameworkManager)
* This is the main class through which Python interacts with Mantid and with the exception of PyAlgorithm and V3D,
* is the only one directly instantiable in Python
Gigg, Martyn Anthony
committed
*/
Gigg, Martyn Anthony
committed
class_<FrameworkManagerProxy, FrameworkProxyCallback, boost::noncopyable>("FrameworkManager")
Gigg, Martyn Anthony
committed
.def("clear", &FrameworkManagerProxy::clear)
.def("clearAlgorithms", &FrameworkManagerProxy::clearAlgorithms)
.def("clearData", &FrameworkManagerProxy::clearData)
.def("clearInstruments", &FrameworkManagerProxy::clearInstruments)
.def("createAlgorithm", (createAlg_overload1)&FrameworkManagerProxy::createAlgorithm,
Gigg, Martyn Anthony
committed
return_value_policy< reference_existing_object >())
Gigg, Martyn Anthony
committed
.def("createAlgorithm", (createAlg_overload2)&FrameworkManagerProxy::createAlgorithm,
Gigg, Martyn Anthony
committed
return_value_policy< reference_existing_object >())
Gigg, Martyn Anthony
committed
.def("createAlgorithm", (createAlg_overload3)&FrameworkManagerProxy::createAlgorithm,
return_value_policy< reference_existing_object >())
.def("createAlgorithm", (createAlg_overload4)&FrameworkManagerProxy::createAlgorithm,
return_value_policy< reference_existing_object >())
Gigg, Martyn Anthony
committed
.def("registerPyAlgorithm", &FrameworkManagerProxy::registerPyAlgorithm)
.def("_observeAlgFactoryUpdates", &FrameworkManagerProxy::observeAlgFactoryUpdates)
Gigg, Martyn Anthony
committed
.def("deleteWorkspace", &FrameworkManagerProxy::deleteWorkspace)
.def("getWorkspaceNames", &FrameworkManagerProxy::getWorkspaceNames)
.def("getWorkspaceGroupNames", &FrameworkManagerProxy::getWorkspaceGroupNames)
.def("getWorkspaceGroupEntries", &FrameworkManagerProxy::getWorkspaceGroupEntries)
.def("createPythonSimpleAPI", &FrameworkManagerProxy::createPythonSimpleAPI)
.def("sendLogMessage", &FrameworkManagerProxy::sendLogMessage)
.def("workspaceExists", &FrameworkManagerProxy::workspaceExists)
Gigg, Martyn Anthony
committed
.def("getConfigProperty", &FrameworkManagerProxy::getConfigProperty)
Gigg, Martyn Anthony
committed
.def("_getRawMatrixWorkspacePointer", &FrameworkManagerProxy::retrieveMatrixWorkspace)
.def("_getRawTableWorkspacePointer", &FrameworkManagerProxy::retrieveTableWorkspace)
.def("_getRawWorkspaceGroupPointer", &FrameworkManagerProxy::retrieveWorkspaceGroup)
Gigg, Martyn Anthony
committed
.def("_workspaceRemoved", &FrameworkProxyCallback::default_workspaceRemoved)
.def("_workspaceReplaced", &FrameworkProxyCallback::default_workspaceReplaced)
.def("_workspaceAdded", &FrameworkProxyCallback::default_workspaceAdded)
.def("_workspaceStoreCleared", &FrameworkProxyCallback::default_workspaceStoreCleared)
.def("_algorithmFactoryUpdated", &FrameworkProxyCallback::default_algorithmFactoryUpdated)
Gigg, Martyn Anthony
committed
.def("_setGILRequired", &FrameworkManagerProxy::setGILRequired)
Gigg, Martyn Anthony
committed
.staticmethod("_setGILRequired")
Gigg, Martyn Anthony
committed
;
Gigg, Martyn Anthony
committed
}
void export_ialgorithm()
{
Gigg, Martyn Anthony
committed
Gigg, Martyn Anthony
committed
register_ptr_to_python<Mantid::API::IAlgorithm*>();
class_< Mantid::API::IAlgorithm, boost::noncopyable>("IAlgorithm", no_init)
.def("initialize", &Mantid::API::IAlgorithm::initialize)
.def("execute", &Mantid::API::IAlgorithm::execute)
Gigg, Martyn Anthony
committed
.def("executeAsync", &Mantid::API::IAlgorithm::executeAsync)
.def("isRunningAsync", &Mantid::API::IAlgorithm::isRunningAsync)
Gigg, Martyn Anthony
committed
.def("isInitialized", &Mantid::API::IAlgorithm::isInitialized)
.def("isExecuted", &Mantid::API::IAlgorithm::isExecuted)
Peterson, Peter
committed
.def("setRethrows", &Mantid::API::IAlgorithm::setRethrows)
Gigg, Martyn Anthony
committed
.def("setPropertyValue", &Mantid::API::IAlgorithm::setPropertyValue)
.def("getPropertyValue", &Mantid::API::IAlgorithm::getPropertyValue)
.def("getProperties", &Mantid::API::IAlgorithm::getProperties, return_value_policy< copy_const_reference >())
;
Gigg, Martyn Anthony
committed
class_< Mantid::API::Algorithm, bases<Mantid::API::IAlgorithm>, boost::noncopyable>("IAlgorithm", no_init)
;
class_< Mantid::API::CloneableAlgorithm, bases<Mantid::API::Algorithm>, boost::noncopyable>("CloneableAlgorithm", no_init)
;
Gigg, Martyn Anthony
committed
Gigg, Martyn Anthony
committed
//PyAlgorithmBase
//Save some typing for all of the templated declareProperty and getProperty methods
Gigg, Martyn Anthony
committed
#define EXPORT_DECLAREPROPERTY(type, suffix)\
Gigg, Martyn Anthony
committed
.def("declareProperty_"#suffix,(void(PyAlgorithmBase::*)(const std::string &, type, const std::string &,const unsigned int))&PyAlgorithmBase::_declareProperty<type>) \
.def("declareProperty_"#suffix,(void(PyAlgorithmBase::*)(const std::string &, type, Kernel::IValidator<type> &,const std::string &,const unsigned int))&PyAlgorithmBase::_declareProperty<type>) \
Gigg, Martyn Anthony
committed
.def("declareListProperty_"#suffix,(void(PyAlgorithmBase::*)(const std::string &, boost::python::list, const std::string &,const unsigned int))&PyAlgorithmBase::_declareListProperty<type>)\
.def("declareListProperty_"#suffix,(void(PyAlgorithmBase::*)(const std::string &, boost::python::list, Kernel::IValidator<type> &,const std::string &,const unsigned int))&PyAlgorithmBase::_declareListProperty<type>)
Gigg, Martyn Anthony
committed
#define EXPORT_GETPROPERTY(type, suffix)\
.def("getProperty_"#suffix,(type(PyAlgorithmBase::*)(const std::string &))&PyAlgorithmBase::_getProperty<type>)
#define EXPORT_GETLISTPROPERTY(type, suffix)\
.def("getListProperty_"#suffix,(std::vector<type>(PyAlgorithmBase::*)(const std::string &))&PyAlgorithmBase::_getListProperty<type>)
Gigg, Martyn Anthony
committed
class_< PyAlgorithmBase, boost::shared_ptr<PyAlgorithmCallback>, bases<Mantid::API::CloneableAlgorithm>,
boost::noncopyable >("PyAlgorithmBase")
.enable_pickling()
.def("_setMatrixWorkspaceProperty", &PyAlgorithmBase::_setMatrixWorkspaceProperty)
.def("_setTableWorkspaceProperty", &PyAlgorithmBase::_setTableWorkspaceProperty)
.def("_declareFileProperty", &PyAlgorithmBase::_declareFileProperty)
.def("_declareMatrixWorkspace", (void(PyAlgorithmBase::*)(const std::string &, const std::string &,const std::string &, const unsigned int))&PyAlgorithmBase::_declareMatrixWorkspace)
.def("_declareMatrixWorkspace", (void(PyAlgorithmBase::*)(const std::string &, const std::string &,Kernel::IValidator<boost::shared_ptr<API::MatrixWorkspace> >&,const std::string &, const unsigned int))&PyAlgorithmBase::_declareMatrixWorkspace)
Gigg, Martyn Anthony
committed
.def("_declareTableWorkspace", &PyAlgorithmBase::_declareTableWorkspace)
.def("log", &PyAlgorithmBase::getLogger, return_internal_reference<>())
Gigg, Martyn Anthony
committed
EXPORT_DECLAREPROPERTY(int, int)
EXPORT_DECLAREPROPERTY(double, dbl)
EXPORT_DECLAREPROPERTY(std::string, str)
Gigg, Martyn Anthony
committed
EXPORT_DECLAREPROPERTY(bool, bool)
EXPORT_GETPROPERTY(int, int)
EXPORT_GETLISTPROPERTY(int, int)
EXPORT_GETPROPERTY(double, dbl)
EXPORT_GETLISTPROPERTY(double, dbl)
EXPORT_GETPROPERTY(bool, bool)
;
//Leave the place tidy
#undef EXPORT_DECLAREPROPERTY
#undef EXPORT_GETPROPERTY
Gigg, Martyn Anthony
committed
#undef EXPORT_GETLISTPROPERTY
Gigg, Martyn Anthony
committed
}
void export_workspace()
{
Gigg, Martyn Anthony
committed
/// Shared pointer registration
register_ptr_to_python<boost::shared_ptr<Workspace> >();
Gigg, Martyn Anthony
committed
class_<Mantid::API::Workspace, boost::noncopyable>("Workspace", no_init)
.def("getTitle", &Mantid::API::Workspace::getTitle,
Russell Taylor
committed
return_value_policy< copy_const_reference >())
Gigg, Martyn Anthony
committed
.def("getComment", &Mantid::API::MatrixWorkspace::getComment,
Russell Taylor
committed
return_value_policy< copy_const_reference >() )
Gigg, Martyn Anthony
committed
.def("getMemorySize", &Mantid::API::Workspace::getMemorySize)
Gigg, Martyn Anthony
committed
.def("getName", &Mantid::API::Workspace::getName, return_value_policy< copy_const_reference >())
.def("__str__", &Mantid::API::Workspace::getName, return_value_policy< copy_const_reference >())
Gigg, Martyn Anthony
committed
;
}
Gigg, Martyn Anthony
committed
// Overloads for binIndexOf function which has 1 optional argument
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(MatrixWorkspace_binIndexOfOverloads, Mantid::API::MatrixWorkspace::binIndexOf, 1, 2)
Gigg, Martyn Anthony
committed
void export_matrixworkspace()
{
/// Shared pointer registration
register_ptr_to_python<boost::shared_ptr<MatrixWorkspace> >();
// A vector of MatrixWorkspace pointers
Gigg, Martyn Anthony
committed
vector_proxy<MatrixWorkspace*>::wrap("stl_vector_matrixworkspace");
Gigg, Martyn Anthony
committed
//Operator overloads dispatch through the above structure. The typedefs save some typing
Gigg, Martyn Anthony
committed
typedef WorkspaceAlgebraProxy::wraptype_ptr(*binary_fn1)(const WorkspaceAlgebraProxy::wraptype_ptr, const WorkspaceAlgebraProxy::wraptype_ptr);
typedef WorkspaceAlgebraProxy::wraptype_ptr(*binary_fn2)(const WorkspaceAlgebraProxy::wraptype_ptr, double);
/// Typedef for data access
typedef Mantid::MantidVec&(Mantid::API::MatrixWorkspace::*data_access)(int const);
Gigg, Martyn Anthony
committed
//MatrixWorkspace class
Gigg, Martyn Anthony
committed
class_< Mantid::API::MatrixWorkspace, bases<Mantid::API::Workspace>, MatrixWorkspaceCallback,
boost::noncopyable >("MatrixWorkspace", no_init)
Gigg, Martyn Anthony
committed
.def("getNumberHistograms", &Mantid::API::MatrixWorkspace::getNumberHistograms)
Gigg, Martyn Anthony
committed
.def("getNumberBins", &Mantid::API::MatrixWorkspace::blocksize)
.def("binIndexOf", &Mantid::API::MatrixWorkspace::binIndexOf, MatrixWorkspace_binIndexOfOverloads() )
Gigg, Martyn Anthony
committed
.def("readX", &Mantid::API::MatrixWorkspace::readX, return_value_policy<return_by_value>() )
.def("readY", &Mantid::API::MatrixWorkspace::readY, return_value_policy<return_by_value>() )
.def("readE", &Mantid::API::MatrixWorkspace::readE, return_value_policy<return_by_value>() )
.def("dataX", (data_access)&Mantid::API::MatrixWorkspace::dataX, return_internal_reference<>() )
.def("dataY", (data_access)&Mantid::API::MatrixWorkspace::dataY, return_internal_reference<>() )
.def("dataE", (data_access)&Mantid::API::MatrixWorkspace::dataE, return_internal_reference<>() )
Gigg, Martyn Anthony
committed
.def("isDistribution", (const bool& (Mantid::API::MatrixWorkspace::*)() const)&Mantid::API::MatrixWorkspace::isDistribution,
Russell Taylor
committed
return_value_policy< copy_const_reference >() )
Gigg, Martyn Anthony
committed
.def("getInstrument", &Mantid::API::MatrixWorkspace::getInstrument)
.def("getDetector", &Mantid::API::MatrixWorkspace::getDetector)
Gigg, Martyn Anthony
committed
.def("getRun", &Mantid::API::MatrixWorkspace::run, return_internal_reference<>() )
Gigg, Martyn Anthony
committed
.def("getSampleInfo", &Mantid::API::MatrixWorkspace::sample, return_internal_reference<>() )
Gigg, Martyn Anthony
committed
.def("__add__", (binary_fn1)&WorkspaceAlgebraProxy::plus)
.def("__add__", (binary_fn2)&WorkspaceAlgebraProxy::plus)
.def("__radd__",(binary_fn2)&WorkspaceAlgebraProxy::rplus)
.def("__iadd__",(binary_fn1)&WorkspaceAlgebraProxy::inplace_plus)
.def("__iadd__",(binary_fn2)&WorkspaceAlgebraProxy::inplace_plus)
.def("__sub__", (binary_fn1)&WorkspaceAlgebraProxy::minus)
.def("__sub__", (binary_fn2)&WorkspaceAlgebraProxy::minus)
.def("__rsub__",(binary_fn2)&WorkspaceAlgebraProxy::rminus)
.def("__isub__",(binary_fn1)&WorkspaceAlgebraProxy::inplace_minus)
.def("__isub__",(binary_fn2)&WorkspaceAlgebraProxy::inplace_minus)
.def("__mul__", (binary_fn1)&WorkspaceAlgebraProxy::times)
.def("__mul__", (binary_fn2)&WorkspaceAlgebraProxy::times)
.def("__rmul__",(binary_fn2)&WorkspaceAlgebraProxy::rtimes)
.def("__imul__",(binary_fn1)&WorkspaceAlgebraProxy::inplace_times)
.def("__imul__",(binary_fn2)&WorkspaceAlgebraProxy::inplace_times)
.def("__div__", (binary_fn1)&WorkspaceAlgebraProxy::divide)
.def("__div__", (binary_fn2)&WorkspaceAlgebraProxy::divide)
.def("__rdiv__", (binary_fn2)&WorkspaceAlgebraProxy::rdivide)
.def("__idiv__",(binary_fn1)&WorkspaceAlgebraProxy::inplace_divide)
.def("__idiv__",(binary_fn2)&WorkspaceAlgebraProxy::inplace_divide)
Gigg, Martyn Anthony
committed
// Deprecated, here for backwards compatability
.def("blocksize", &Mantid::API::MatrixWorkspace::blocksize)
Gigg, Martyn Anthony
committed
.def("getSampleDetails", &Mantid::API::MatrixWorkspace::run, return_internal_reference<>() )
Gigg, Martyn Anthony
committed
;
}
void export_tableworkspace()
{
// Declare the pointer
Gigg, Martyn Anthony
committed
register_ptr_to_python<Mantid::API::ITableWorkspace_sptr>();
// Table workspace
// Some function pointers since MSVC can't figure out the function to call when
// placing this directly in the .def functions below
typedef int&(ITableWorkspace::*get_integer_ptr)(const std::string &, int);
typedef double&(ITableWorkspace::*get_double_ptr)(const std::string &, int);
typedef std::string&(ITableWorkspace::*get_string_ptr)(const std::string &, int);
Gigg, Martyn Anthony
committed
// TableWorkspace class
Gigg, Martyn Anthony
committed
class_< ITableWorkspace, bases<Mantid::API::Workspace>, boost::noncopyable >("ITableWorkspace", no_init)
.def("getColumnCount", &ITableWorkspace::columnCount)
.def("getRowCount", &ITableWorkspace::rowCount)
.def("getColumnNames",&ITableWorkspace::getColumnNames)
.def("getInt", (get_integer_ptr)&ITableWorkspace::getRef<int>, return_value_policy<copy_non_const_reference>())
.def("getDouble", (get_double_ptr)&ITableWorkspace::getRef<double>, return_value_policy<copy_non_const_reference>())
.def("getString", (get_string_ptr)&ITableWorkspace::getRef<std::string>, return_value_policy<copy_non_const_reference>())
Gigg, Martyn Anthony
committed
;
}
// WorkspaceGroup
void export_workspacegroup()
{
// Pointer
Gigg, Martyn Anthony
committed
register_ptr_to_python<Mantid::API::WorkspaceGroup_sptr>();
Gigg, Martyn Anthony
committed
Gigg, Martyn Anthony
committed
class_< Mantid::API::WorkspaceGroup, bases<Mantid::API::Workspace>,
boost::noncopyable >("WorkspaceGroup", no_init)
Gigg, Martyn Anthony
committed
.def("size", &Mantid::API::WorkspaceGroup::getNumberOfEntries)
Gigg, Martyn Anthony
committed
.def("getNames", &Mantid::API::WorkspaceGroup::getNames)
Gigg, Martyn Anthony
committed
.def("add", &Mantid::API::WorkspaceGroup::add)
.def("remove", &Mantid::API::WorkspaceGroup::remove)
;
}
void export_sample()
{
//Pointer
Gigg, Martyn Anthony
committed
register_ptr_to_python<Mantid::API::Sample*>();
Gigg, Martyn Anthony
committed
//Sample class
Gigg, Martyn Anthony
committed
class_< Mantid::API::Sample, boost::noncopyable >("Sample", no_init)
Gigg, Martyn Anthony
committed
.def("getName", &Mantid::API::Sample::getName, return_value_policy<copy_const_reference>())
.def("getGeometryFlag", &Mantid::API::Sample::getGeometryFlag)
.def("getThickness", &Mantid::API::Sample::getThickness)
.def("getHeight", &Mantid::API::Sample::getHeight)
.def("getWidth", &Mantid::API::Sample::getWidth)
Gigg, Martyn Anthony
committed
;
}
Gigg, Martyn Anthony
committed
void export_run()
{
//Pointer
register_ptr_to_python<Mantid::API::Run*>();
//Run class
Gigg, Martyn Anthony
committed
class_< Mantid::API::Run, boost::noncopyable >("Run", no_init)
Gigg, Martyn Anthony
committed
.def("getLogData", (Mantid::Kernel::Property* (Mantid::API::Run::*)(const std::string&) const)&Run::getLogData,
return_internal_reference<>())
.def("getLogData", (const std::vector<Mantid::Kernel::Property*> & (Mantid::API::Run::*)() const)&Run::getLogData,
return_internal_reference<>())
.def("getProtonCharge", &Mantid::API::Run::getProtonCharge)
Gigg, Martyn Anthony
committed
.def("hasProperty", &Mantid::API::Run::hasProperty)
.def("getProperty", &Mantid::API::Run::getProperty, return_value_policy<return_by_value>())
.def("getProperties", &Mantid::API::Run::getProperties, return_internal_reference<>())
Gigg, Martyn Anthony
committed
;
}
Gigg, Martyn Anthony
committed
void export_instrument()
{
//Pointer to the interface
register_ptr_to_python<boost::shared_ptr<Mantid::API::IInstrument> >();
//IInstrument class
Gigg, Martyn Anthony
committed
class_< Mantid::API::IInstrument, boost::python::bases<Mantid::Geometry::ICompAssembly>,
boost::noncopyable>("IInstrument", no_init)
Gigg, Martyn Anthony
committed
.def("getSample", &Mantid::API::IInstrument::getSample)
.def("getSource", &Mantid::API::IInstrument::getSource)
.def("getComponentByName", &Mantid::API::IInstrument::getComponentByName)
;
/** Concrete implementations so that Python knows about them */
//Instrument class
Gigg, Martyn Anthony
committed
class_< Mantid::API::Instrument, boost::python::bases<Mantid::API::IInstrument>,
boost::noncopyable>("Instrument", no_init)
Gigg, Martyn Anthony
committed
;
//Instrument class
Gigg, Martyn Anthony
committed
class_< Mantid::API::ParInstrument, boost::python::bases<Mantid::API::IInstrument>,
boost::noncopyable>("ParInstrument", no_init)
;
Gigg, Martyn Anthony
committed
}
Gigg, Martyn Anthony
committed
void export_workspace_property()
{
// Tell python about this so I can check if a property is a workspace
class_< WorkspaceProperty<Workspace>, bases<Mantid::Kernel::Property>, boost::noncopyable>("WorkspaceProperty", no_init)
;
Gigg, Martyn Anthony
committed
// Tell python about this so I can check if a property is a workspace
class_< WorkspaceProperty<MatrixWorkspace>, bases<Mantid::Kernel::Property>, boost::noncopyable>("MatrixWorkspaceProperty", no_init)
;
// Tell python about this so I can check if a property is a workspace
class_< WorkspaceProperty<ITableWorkspace>, bases<Mantid::Kernel::Property>, boost::noncopyable>("TableWorkspaceProperty", no_init)
;
Gigg, Martyn Anthony
committed
}
Gigg, Martyn Anthony
committed
void export_fileproperty()
{
//FileProperty enum
enum_<FileProperty::FileAction>("FileAction")
.value("Save", FileProperty::Save)
.value("OptionalSave", FileProperty::OptionalSave)
.value("Load", FileProperty::Load)
.value("OptionalLoad", FileProperty::OptionalLoad)
;
}
Gigg, Martyn Anthony
committed
void export_workspacefactory()
{
Gigg, Martyn Anthony
committed
class_< PythonAPI::WorkspaceFactoryProxy, boost::noncopyable>("WorkspaceFactoryProxy", no_init)
.def("createMatrixWorkspace", &PythonAPI::WorkspaceFactoryProxy::createMatrixWorkspace)
Gigg, Martyn Anthony
committed
.staticmethod("createMatrixWorkspace")
Gigg, Martyn Anthony
committed
.def("createMatrixWorkspaceFromTemplate",&PythonAPI::WorkspaceFactoryProxy::createMatrixWorkspaceFromTemplate)
.staticmethod("createMatrixWorkspaceFromTemplate")
void export_apivalidators()
{
class_<Kernel::IValidator<API::MatrixWorkspace_sptr>, boost::noncopyable>("IValidator_matrix", no_init)
;
// Unit checking
Gigg, Martyn Anthony
committed
class_<API::WorkspaceUnitValidator<API::MatrixWorkspace>,
bases<Kernel::IValidator<API::MatrixWorkspace_sptr> > >("WorkspaceUnitValidator", init<std::string>())
;
// Histogram checking
Gigg, Martyn Anthony
committed
class_<API::HistogramValidator<API::MatrixWorkspace>,
bases<Kernel::IValidator<API::MatrixWorkspace_sptr> > >("HistogramValidator", init<bool>())
Gigg, Martyn Anthony
committed
class_<API::RawCountValidator<API::MatrixWorkspace>,
bases<Kernel::IValidator<API::MatrixWorkspace_sptr> > >("RawCountValidator", init<bool>())
;
// Check for common bins
Gigg, Martyn Anthony
committed
class_<API::CommonBinsValidator<API::MatrixWorkspace>,
bases<Kernel::IValidator<API::MatrixWorkspace_sptr> > >("CommonBinsValidator")
void export_file_finder()
{
class_<PythonAPI::FileFinderWrapper, boost::noncopyable>("FileFinder", no_init)
.def("getFullPath", &PythonAPI::FileFinderWrapper::getFullPath)
.staticmethod("getFullPath")
.def("findRuns", &PythonAPI::FileFinderWrapper::findRuns)
.staticmethod("findRuns")
;
}
Gigg, Martyn Anthony
committed
void export_api_namespace()
{
export_frameworkmanager();
export_ialgorithm();
export_workspace();
export_matrixworkspace();
export_tableworkspace();
export_workspacegroup();
export_sample();
Gigg, Martyn Anthony
committed
export_run();
Gigg, Martyn Anthony
committed
export_instrument();
Gigg, Martyn Anthony
committed
export_workspace_property();
Gigg, Martyn Anthony
committed
export_fileproperty();
export_workspacefactory();
Gigg, Martyn Anthony
committed
}