diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h b/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h index f28cb82152330306db9044da42922b1e994284c0..aff1c6a9507ca2431c3838f5558181fc7933a5b9 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h @@ -134,10 +134,10 @@ template <typename WorkspaceType> struct WorkspacePropertyExporter { API::PropertyMode::Type, API::LockMode::Type>( args("name", "defaultValue", "direction", "optional", "locking"))) // These variants require the validator object to be cloned - .def("__init__", - make_constructor( - &createPropertyWithValidator, default_call_policies(), - args("name", "defaultValue", "direction", "validator"))) + .def("__init__", make_constructor(&createPropertyWithValidator, + default_call_policies(), + (arg("name"), arg("defaultValue"), + arg("direction"), arg("validator")))) .def("__init__", make_constructor(&createPropertyWithOptionalFlag, default_call_policies(), @@ -148,7 +148,7 @@ template <typename WorkspaceType> struct WorkspacePropertyExporter { default_call_policies(), args("name", "defaultValue", "direction", "optional", "locking", "validator"))) - .def("isOptional", &TypedWorkspaceProperty::isOptional, + .def("isOptional", &TypedWorkspaceProperty::isOptional, arg("self"), "Returns true if the property has been marked as optional") .add_property("value", &value); diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h index 5de200f77772535379d80f49cc8303345a0d4aba..90679c67007c4a433a9654ac8c4b214633f45354 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h @@ -66,30 +66,37 @@ template <typename SvcType, typename SvcPtrType> struct DataServiceExporter { auto classType = PythonType(pythonClassName, no_init) .def("add", &DataServiceExporter::addItem, + (arg("self"), arg("name"), arg("item")), "Adds the given object to the service with the given name. If " "the name/object exists it will raise an error.") .def("addOrReplace", &DataServiceExporter::addOrReplaceItem, + (arg("self"), arg("name"), arg("item")), "Adds the given object to the service with the given name. " "The the name exists the object is replaced.") - .def("doesExist", &SvcType::doesExist, + .def("doesExist", &SvcType::doesExist, (arg("self"), arg("name")), "Returns True if the object is found in the service.") .def("retrieve", &DataServiceExporter::retrieveOrKeyError, + (arg("self"), arg("name")), "Retrieve the named object. Raises an exception if the name " "does not exist") - .def("remove", &SvcType::remove, "Remove a named object") - .def("clear", &SvcType::clear, + .def("remove", &SvcType::remove, (arg("self"), arg("name")), + "Remove a named object") + .def("clear", &SvcType::clear, arg("self"), "Removes all objects managed by the service.") - .def("size", &SvcType::size, + .def("size", &SvcType::size, arg("self"), "Returns the number of objects within the service") .def("getObjectNames", &DataServiceExporter::getObjectNamesAsList, + arg("self"), "Return the list of names currently known to the ADS") // Make it act like a dictionary - .def("__len__", &SvcType::size) - .def("__getitem__", &DataServiceExporter::retrieveOrKeyError) - .def("__setitem__", &DataServiceExporter::addOrReplaceItem) - .def("__contains__", &SvcType::doesExist) - .def("__delitem__", &SvcType::remove); + .def("__len__", &SvcType::size, arg("self")) + .def("__getitem__", &DataServiceExporter::retrieveOrKeyError, + (arg("self"), arg("name"))) + .def("__setitem__", &DataServiceExporter::addOrReplaceItem, + (arg("self"), arg("name"), arg("item"))) + .def("__contains__", &SvcType::doesExist, arg("self")) + .def("__delitem__", &SvcType::remove, (arg("self"), arg("name"))); return classType; } diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h index e876486b65ce12d54ea8a1a57c5e651db2a7a722..aed38b70fe762cec3f5f3df0fa9c7fc1038125f5 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h @@ -39,7 +39,7 @@ template <typename Type> struct TypedValidatorExporter { class_<TypedValidator<Type>, bases<IValidator>, boost::noncopyable>( pythonClassName, no_init) - .def("isValid", &IValidator::isValid<Type>, + .def("isValid", &IValidator::isValid<Type>, (arg("self"), arg("value")), "Returns an empty string if the value is considered valid, " "otherwise a string defining the error is returned."); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp index 843ccf1e8b1eaa9ca3ad952c8f491d400455e074..44b07a508d7484ec85fd0d0b15371ab40f1f85c4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp @@ -83,22 +83,19 @@ void export_leaf_classes() { .def("fromString", &Algorithm::fromString, "Initialize the algorithm from a string representation") .staticmethod("fromString") - .def("createChildAlgorithm", &Algorithm::createChildAlgorithm, - (arg("name"), arg("startProgress") = -1.0, arg("endProgress") = -1.0, - arg("enableLogging") = true, arg("version") = -1), + (arg("self"), arg("name"), arg("startProgress") = -1.0, + arg("endProgress") = -1.0, arg("enableLogging") = true, + arg("version") = -1), "Creates and intializes a named child algorithm. Output workspaces " "are given a dummy name.") - .def("declareProperty", (declarePropertyType1)&PythonAlgorithm::declarePyAlgProperty, declarePropertyType1_Overload( (arg("self"), arg("prop"), arg("doc") = ""))) - .def("enableHistoryRecordingForChild", - &Algorithm::enableHistoryRecordingForChild, (args("on")), + &Algorithm::enableHistoryRecordingForChild, (arg("self"), arg("on")), "Turns history recording on or off for an algorithm.") - .def("declareProperty", (declarePropertyType2)&PythonAlgorithm::declarePyAlgProperty, declarePropertyType2_Overload( @@ -108,7 +105,6 @@ void export_leaf_classes() { "Declares a named property where the type is taken from " "the type of the defaultValue and mapped to an appropriate C++ " "type")) - .def("declareProperty", (declarePropertyType3)&PythonAlgorithm::declarePyAlgProperty, declarePropertyType3_Overload( @@ -117,23 +113,22 @@ void export_leaf_classes() { "Declares a named property where the type is taken from the " "type " "of the defaultValue and mapped to an appropriate C++ type")) - .def("declareProperty", (declarePropertyType4)&PythonAlgorithm::declarePyAlgProperty, (arg("self"), arg("name"), arg("defaultValue"), arg("direction") = Direction::Input), "Declares a named property where the type is taken from the type " "of the defaultValue and mapped to an appropriate C++ type") - - .def("getLogger", &PythonAlgorithm::getLogger, + .def("getLogger", &PythonAlgorithm::getLogger, arg("self"), return_value_policy<reference_existing_object>(), "Returns a reference to this algorithm's logger") - .def("log", &PythonAlgorithm::getLogger, + .def("log", &PythonAlgorithm::getLogger, arg("self"), return_value_policy<reference_existing_object>(), "Returns a reference to this algorithm's logger") // Traditional name // deprecated methods .def("setWikiSummary", &PythonAlgorithm::setWikiSummary, + (arg("self"), arg("summary")), "(Deprecated.) Set summary for the help."); // Prior to version 3.2 there was a separate C++ PythonAlgorithm class that diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp index 14fa42684ddb16434842304533d8508d63033ff7..16596444d5052301e09371c9ef001fdf29eb5665 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp @@ -125,12 +125,15 @@ void export_AlgorithmFactory() { "an option to specify the version")) .def("getRegisteredAlgorithms", &getRegisteredAlgorithms, + (arg("self"), arg("include_hidden")), "Returns a Python dictionary of currently registered algorithms") .def("highestVersion", &AlgorithmFactoryImpl::highestVersion, + (arg("self"), arg("algorithm_name")), "Returns the highest version of the named algorithm. Throws " "ValueError if no algorithm can be found") - .def("subscribe", &subscribe, "Register a Python class derived from " - "PythonAlgorithm into the factory") + .def("subscribe", &subscribe, (arg("self"), arg("object")), + "Register a Python class derived from " + "PythonAlgorithm into the factory") .def("Instance", &AlgorithmFactory::Instance, return_value_policy<reference_existing_object>(), diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp index 8c886db7e8e024996dfda59da964188d8b61eb96..05a5f7045434a46b2bbd1ba14e0f7e9a2b35ec6a 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp @@ -58,40 +58,42 @@ void export_AlgorithmHistory() { register_ptr_to_python<Mantid::API::AlgorithmHistory_sptr>(); class_<AlgorithmHistory>("AlgorithmHistory", no_init) - .def("name", &AlgorithmHistory::name, + .def("name", &AlgorithmHistory::name, arg("self"), return_value_policy<copy_const_reference>(), "Returns the name of the algorithm.") - .def("version", &AlgorithmHistory::version, + .def("version", &AlgorithmHistory::version, arg("self"), return_value_policy<copy_const_reference>(), "Returns the version of the algorithm.") .def("executionDuration", &AlgorithmHistory::executionDuration, - "Returns the execution duration of the algorithm.") + arg("self"), "Returns the execution duration of the algorithm.") - .def("executionDate", &AlgorithmHistory::executionDate, + .def("executionDate", &AlgorithmHistory::executionDate, arg("self"), "Returns the execution date of the algorithm.") - .def("execCount", &AlgorithmHistory::execCount, + .def("execCount", &AlgorithmHistory::execCount, arg("self"), return_value_policy<copy_const_reference>(), "Returns the execution number of the algorithm.") - .def("childHistorySize", &AlgorithmHistory::childHistorySize, + .def("childHistorySize", &AlgorithmHistory::childHistorySize, arg("self"), "Returns the number of the child algorithms.") .def("getChildAlgorithmHistory", - &AlgorithmHistory::getChildAlgorithmHistory, arg("index"), + &AlgorithmHistory::getChildAlgorithmHistory, + (arg("self"), arg("index")), "Returns the child algorithm at the given index in the history") - .def("getChildHistories", &getChildrenAsList, "Returns a list of child " - "algorithm histories for " - "this algorithm history.") + .def("getChildHistories", &getChildrenAsList, arg("self"), + "Returns a list of child " + "algorithm histories for " + "this algorithm history.") - .def("getProperties", &getPropertiesAsList, + .def("getProperties", &getPropertiesAsList, arg("self"), "Returns properties for this algorithm history.") .def("getChildAlgorithm", &AlgorithmHistory::getChildAlgorithm, - arg("index"), + (arg("self"), arg("index")), "Returns the algorithm at the given index in the history") // ----------------- Operators -------------------------------------- .def(self_ns::str(self)); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp index 15aa52abed074a2c1c67e30a011043c131cc01a6..283b71e128e716988c2c52cc63c09f788932503f 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp @@ -86,22 +86,25 @@ void export_AlgorithmManager() { .def("createUnmanaged", &AlgorithmManagerImpl::createUnmanaged, createUnmanaged_overloads((arg("name"), arg("version")), "Creates an unmanaged algorithm.")) - .def("size", &AlgorithmManagerImpl::size, + .def("size", &AlgorithmManagerImpl::size, arg("self"), "Returns the number of managed algorithms") .def("setMaxAlgorithms", &AlgorithmManagerImpl::setMaxAlgorithms, + (arg("self"), arg("n")), "Set the maximum number of allowed managed algorithms") - .def("getAlgorithm", &getAlgorithm, + .def("getAlgorithm", &getAlgorithm, (arg("self"), arg("id_holder")), "Return the algorithm instance identified by the given id.") - .def("removeById", &removeById, + .def("removeById", &removeById, (arg("self"), arg("id_holder")), "Remove an algorithm from the managed list") .def("newestInstanceOf", &AlgorithmManagerImpl::newestInstanceOf, + (arg("self"), arg("algorithm_name")), "Returns the newest created instance of the named algorithm") .def("runningInstancesOf", &runningInstancesOf, + (arg("self"), arg("algorithm_name")), "Returns a list of managed algorithm instances that are " "currently executing") - .def("clear", &AlgorithmManagerImpl::clear, + .def("clear", &AlgorithmManagerImpl::clear, arg("self"), "Clears the current list of managed algorithms") - .def("cancelAll", &AlgorithmManagerImpl::cancelAll, + .def("cancelAll", &AlgorithmManagerImpl::cancelAll, arg("self"), "Requests that all currently running algorithms be cancelled"); // Instance method diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp index 134ea0eecfdb293583ce9e7ef8a67dbb8de7479b..664da1fb0da97aea7d9a3bfca91669d1b2683fa9 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp @@ -83,33 +83,41 @@ void export_Axis() { // Class class_<Axis, boost::noncopyable>("MantidAxis", no_init) - .def("length", &Axis::length, "Returns the length of the axis") + .def("length", &Axis::length, arg("self"), + "Returns the length of the axis") .def("title", (const std::string &(Axis::*)() const) & Axis::title, - return_value_policy<copy_const_reference>(), "Get the axis title") - .def("isSpectra", &Axis::isSpectra, + arg("self"), return_value_policy<copy_const_reference>(), + "Get the axis title") + .def("isSpectra", &Axis::isSpectra, arg("self"), "Returns true if this is a SpectraAxis") - .def("isNumeric", &Axis::isNumeric, + .def("isNumeric", &Axis::isNumeric, arg("self"), "Returns true if this is a NumericAxis") - .def("isText", &Axis::isText, "Returns true if this is a TextAxis") - .def("label", &Axis::label, "Return the axis label") + .def("isText", &Axis::isText, arg("self"), + "Returns true if this is a TextAxis") + .def("label", &Axis::label, (arg("self"), arg("index")), + "Return the axis label") .def("getUnit", (const Unit_sptr &(Axis::*)() const) & Axis::unit, - return_value_policy<copy_const_reference>(), + arg("self"), return_value_policy<copy_const_reference>(), "Returns the unit object for the axis") .def("getValue", &Axis::getValue, - Axis_getValue(args("index", "vertical_index"), + Axis_getValue((arg("self"), arg("index"), arg("vertical_index")), "Returns the value at the given point on the Axis. " "The vertical axis index [default=0]")) - .def("extractValues", &extractAxisValues, + .def("extractValues", &extractAxisValues, arg("self"), "Return a numpy array of the axis values") - .def("setUnit", &Axis::setUnit, + .def("setUnit", &Axis::setUnit, (arg("self"), arg("unit_name")), return_value_policy<copy_const_reference>(), "Set the unit for this axis by name.") - .def("setValue", &Axis::setValue, "Set a value at the given index") - .def("getMin", &Axis::getMin, "Get min value specified on the axis") - .def("getMax", &Axis::getMax, "Get max value specified on the axis") + .def("setValue", &Axis::setValue, + (arg("self"), arg("index"), arg("value")), + "Set a value at the given index") + .def("getMin", &Axis::getMin, arg("self"), + "Get min value specified on the axis") + .def("getMax", &Axis::getMax, arg("self"), + "Get max value specified on the axis") //------------------------------------ Special methods //------------------------------------ - .def("__len__", &Axis::length); + .def("__len__", &Axis::length, arg("self")); } // -------------------------------------------------------------------------------------------- @@ -128,7 +136,8 @@ void export_NumericAxis() { /// Exported so that Boost.Python can give back a NumericAxis class when an /// Axis* is returned class_<NumericAxis, bases<Axis>, boost::noncopyable>("NumericAxis", no_init) - .def("create", &createNumericAxis, return_internal_reference<>(), + .def("create", &createNumericAxis, arg("length"), + return_internal_reference<>(), "Creates a new NumericAxis of a specified length") .staticmethod("create"); } @@ -151,7 +160,8 @@ void export_BinEdgeAxis() { /// Axis* is returned class_<BinEdgeAxis, bases<NumericAxis>, boost::noncopyable>("BinEdgeAxis", no_init) - .def("create", &createBinEdgeAxis, return_internal_reference<>(), + .def("create", &createBinEdgeAxis, arg("length"), + return_internal_reference<>(), "Creates a new BinEdgeAxis of a specified length") .staticmethod("create"); } @@ -169,9 +179,13 @@ Axis *createTextAxis(int length) { return new Mantid::API::TextAxis(length); } void export_TextAxis() { class_<TextAxis, bases<Axis>, boost::noncopyable>("TextAxis", no_init) - .def("setLabel", &TextAxis::setLabel, "Set the label at the given entry") - .def("label", &TextAxis::label, "Return the label at the given position") - .def("create", &createTextAxis, return_internal_reference<>(), + .def("setLabel", &TextAxis::setLabel, + (arg("self"), arg("index"), arg("label")), + "Set the label at the given entry") + .def("label", &TextAxis::label, (arg("self"), arg("index")), + "Return the label at the given position") + .def("create", &createTextAxis, arg("length"), + return_internal_reference<>(), "Creates a new TextAxis of a specified length") .staticmethod("create"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp b/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp index 7caf592a3ea586aad1dc6544bb2b80c7024c543b..af6debd38bd7864bcda9671f74e9e7979deeeed6 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp @@ -11,24 +11,28 @@ void export_BoxController() { register_ptr_to_python<boost::shared_ptr<BoxController>>(); class_<BoxController, boost::noncopyable>("BoxController", no_init) - .def("getNDims", &BoxController::getNDims, "Get # of dimensions") - .def("getSplitThreshold", &BoxController::getSplitThreshold, + .def("getNDims", &BoxController::getNDims, arg("self"), + "Get # of dimensions") + .def("getSplitThreshold", &BoxController::getSplitThreshold, arg("self"), "Return the splitting threshold, in # of events") .def("getSplitInto", &BoxController::getSplitInto, + (arg("self"), arg("dim")), "Return into how many to split along a dimension") - .def("getMaxDepth", &BoxController::getMaxDepth, + .def("getMaxDepth", &BoxController::getMaxDepth, arg("self"), "Return the max recursion depth allowed for grid box splitting.") .def("getTotalNumMDBoxes", &BoxController::getTotalNumMDBoxes, + arg("self"), "Return the total number of MD Boxes, irrespective of depth") .def("getTotalNumMDGridBoxes", &BoxController::getTotalNumMDGridBoxes, + arg("self"), "Return the total number of MDGridBox'es, irrespective of depth") - .def("getAverageDepth", &BoxController::getAverageDepth, + .def("getAverageDepth", &BoxController::getAverageDepth, arg("self"), "Return the average recursion depth of gridding.") - .def("isFileBacked", &BoxController::isFileBacked, + .def("isFileBacked", &BoxController::isFileBacked, arg("self"), "Return True if the MDEventWorkspace is backed by a file ") - .def("getFilename", &BoxController::getFilename, + .def("getFilename", &BoxController::getFilename, arg("self"), "Return the full path to the file open as the file-based back or " "empty string if no file back-end is initiated") - .def("useWriteBuffer", &BoxController::useWriteBuffer, + .def("useWriteBuffer", &BoxController::useWriteBuffer, arg("self"), "Return true if the MRU should be used"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp index 1dacf9c7bc503e3455d541b358f1beb3dac72b61..00c8a38090785a1306a40883c221b28f3dffbcd5 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp @@ -25,61 +25,72 @@ void export_DataProcessorAlgorithm() { "DataProcessorAlgorithm", "Base class workflow-type algorithms") .def("setLoadAlg", &DataProcessorAdapter::setLoadAlgProxy, + (arg("self"), arg("alg")), "Set the name of the algorithm called using the load() method " "[Default=Load]") .def("setLoadAlgFileProp", &DataProcessorAdapter::setLoadAlgFilePropProxy, + (arg("self"), arg("file_prop_name")), "Set the name of the file property for the load algorithm when " "using " "the load() method [Default=Filename]") .def("setAccumAlg", &DataProcessorAdapter::setAccumAlgProxy, + (arg("self"), arg("alg")), "Set the name of the algorithm called to accumulate a chunk of " "processed data [Default=Plus]") .def("determineChunk", &DataProcessorAdapter::determineChunkProxy, + (arg("self"), arg("file_name")), "Return a TableWorkspace containing the information on how to split " "the " "input file when processing in chunks") .def("loadChunk", &DataProcessorAdapter::loadChunkProxy, - "Load a chunk of data") + (arg("self"), arg("row_index")), "Load a chunk of data") .def("load", (loadOverload1)&DataProcessorAdapter::loadProxy, + (arg("self"), arg("input_data")), "Loads the given file or workspace data and returns the workspace. " "The output is not stored in the AnalysisDataService.") .def("load", (loadOverload2)&DataProcessorAdapter::loadProxy, + (arg("self"), arg("input_data"), arg("load_quite")), "Loads the given file or workspace data and returns the workspace. " "If loadQuiet=True then output is not stored in the " "AnalysisDataService.") .def("splitInput", &DataProcessorAdapter::splitInputProxy, - return_value_policy<VectorToNumpy>()) + (arg("self"), arg("input")), return_value_policy<VectorToNumpy>()) - .def("forwardProperties", &DataProcessorAdapter::forwardPropertiesProxy) + .def("forwardProperties", &DataProcessorAdapter::forwardPropertiesProxy, + arg("self")) .def("getProcessProperties", &DataProcessorAdapter::getProcessPropertiesProxy, + (arg("self"), arg("property_manager")), "Returns the named property manager from the service or creates " "a new one if it does not exist") .def("assemble", &DataProcessorAdapter::assembleProxy, + (arg("self"), arg("partial_wsname"), arg("output_wsname")), "If an MPI build, assemble the partial workspaces from all MPI " "processes. " "Otherwise, simply returns the input workspace") .def("saveNexus", &DataProcessorAdapter::saveNexusProxy, + (arg("self"), arg("output_wsname"), arg("output_filename")), "Save a workspace as a nexus file. If this is an MPI build then " "saving only " "happens for the main thread.") .def("isMainThread", &DataProcessorAdapter::isMainThreadProxy, + arg("self"), "Returns true if this algorithm is the main thread for an MPI " "build. For " "non-MPI build it always returns true") - .def("getNThreads", &DataProcessorAdapter::getNThreadsProxy, + .def("getNThreads", &DataProcessorAdapter::getNThreadsProxy, arg("self"), "Returns the number of running MPI processes in an MPI build or 1 " "for " "a non-MPI build"); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp index 6f50a63f0d945bc3f01b14f5103a8d42f7b63aaa..6d216cc065028263cc2edb49956b08f50b7456bc 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp @@ -23,11 +23,11 @@ void export_FileFinder() { class_<FileFinderImpl, boost::noncopyable>("FileFinderImpl", no_init) .def("getFullPath", &FileFinderImpl::getFullPath, getFullPathOverloader( - (arg("path"), arg("ignoreDirs") = false), + (arg("self"), arg("path"), arg("ignoreDirs") = false), "Return a full path to the given file if it can be found within " "datasearch.directories paths. Directories can be ignored with " "ignoreDirs=True. An empty string is returned otherwise.")) - .def("findRuns", &FileFinderImpl::findRuns, + .def("findRuns", &FileFinderImpl::findRuns, (arg("self"), arg("hintstr")), "Find a list of files file given a hint. " "The hint can be a comma separated list of run numbers and can also " "include ranges of runs, e.g. 123-135 or equivalently 123-35" diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FileLoaderRegistry.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FileLoaderRegistry.cpp index 5935cb7aae9932ac57f2f9c6f8ce18203e867f2d..baa9c3e8a188627728b20dfa745d7dd2cdfbaee7 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FileLoaderRegistry.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FileLoaderRegistry.cpp @@ -10,9 +10,10 @@ void export_FileLoaderRegistry() { class_<FileLoaderRegistryImpl, boost::noncopyable>("FileLoaderRegistryImpl", no_init) .def("canLoad", &FileLoaderRegistryImpl::canLoad, + (arg("self"), arg("algorithm_name"), arg("file_name")), "Perform a check that that the given algorithm can load the file") .def("Instance", &FileLoaderRegistry::Instance, return_value_policy<reference_existing_object>(), "Returns a reference to the FileLoaderRegistry singleton instance") .staticmethod("Instance"); -} \ No newline at end of file +} diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp index 1e31d32096f1b312b05f7f5cfff115ab486ccf85..d6df442a862bd0060019dd70b7ef395c26ec8a73 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp @@ -12,31 +12,34 @@ void export_FrameworkManager() { class_<FrameworkManagerImpl, boost::noncopyable>("FrameworkManagerImpl", no_init) .def("setNumOMPThreadsToConfigValue", - &FrameworkManagerImpl::setNumOMPThreadsToConfigValue, + &FrameworkManagerImpl::setNumOMPThreadsToConfigValue, arg("self"), "Sets the number of OpenMP threads to the value specified in the " "config file") .def("setNumOMPThreads", &FrameworkManagerImpl::setNumOMPThreads, + (arg("self"), arg("nthread")), "Set the number of OpenMP threads to the given value") .def("getNumOMPThreads", &FrameworkManagerImpl::getNumOMPThreads, + arg("self"), "Returns the number of OpenMP threads that will be used.") - .def("clear", &FrameworkManagerImpl::clear, + .def("clear", &FrameworkManagerImpl::clear, arg("self"), "Clear all memory held by Mantid") .def("clearAlgorithms", &FrameworkManagerImpl::clearAlgorithms, + arg("self"), "Clear memory held by algorithms (does not include workspaces)") - .def("clearData", &FrameworkManagerImpl::clearData, + .def("clearData", &FrameworkManagerImpl::clearData, arg("self"), "Clear memory held by the data service (essentially all workspaces, " "including hidden)") .def("clearInstruments", &FrameworkManagerImpl::clearInstruments, - "Clear memory held by the cached instruments") + arg("self"), "Clear memory held by the cached instruments") .def("clearPropertyManagers", - &FrameworkManagerImpl::clearPropertyManagers, + &FrameworkManagerImpl::clearPropertyManagers, arg("self"), "Clear memory held by the PropertyManagerDataService") .def("Instance", &FrameworkManager::Instance, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp index 2d94e8f7aea8f4484f240f8b13488aa68e7a6d44..7735fc15decf7418218e07c3b204f3235ef4774c 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp @@ -89,15 +89,15 @@ void export_FunctionFactory() { class_<FunctionFactoryImpl, boost::noncopyable>("FunctionFactoryImpl", no_init) - .def("getFunctionNames", &getFunctionNames, + .def("getFunctionNames", &getFunctionNames, arg("self"), "Returns a list of the currently available functions") .def("createFunction", &FunctionFactoryImpl::createFunction, + (arg("self"), arg("type")), "Return a pointer to the requested function") - .def("subscribe", &subscribe, + .def("subscribe", &subscribe, (arg("self"), arg("object")), "Register a Python class derived from IFunction into the factory") .def("unsubscribe", &FunctionFactoryImpl::unsubscribe, - "Remove a type from the factory") - + (arg("self"), arg("class_name")), "Remove a type from the factory") .def("Instance", &FunctionFactory::Instance, return_value_policy<reference_existing_object>(), "Returns a reference to the FunctionFactory singleton") diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp index e2be117bf9a2e743ff79c79dfc3e2a0e5843cf51..009ca30fb110ff5ede255104d493cfe8e16fcbdf 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp @@ -302,89 +302,102 @@ void export_ialgorithm() { class_<IAlgorithm, bases<IPropertyManager>, boost::noncopyable>( "IAlgorithm", "Interface for all algorithms", no_init) - .def("name", &IAlgorithm::name, "Returns the name of the algorithm") - .def("alias", &IAlgorithm::alias, "Return the aliases for the algorithm") - .def("version", &IAlgorithm::version, + .def("name", &IAlgorithm::name, arg("self"), + "Returns the name of the algorithm") + .def("alias", &IAlgorithm::alias, arg("self"), + "Return the aliases for the algorithm") + .def("version", &IAlgorithm::version, arg("self"), "Returns the version number of the algorithm") - .def("cancel", &IAlgorithm::cancel, + .def("cancel", &IAlgorithm::cancel, arg("self"), "Request that the algorithm stop running") - .def("category", &IAlgorithm::category, + .def("category", &IAlgorithm::category, arg("self"), "Returns the category containing the algorithm") - .def("categories", &IAlgorithm::categories, + .def("categories", &IAlgorithm::categories, arg("self"), "Returns the list of categories this algorithm belongs to") - .def("summary", &IAlgorithm::summary, + .def("summary", &IAlgorithm::summary, arg("self"), "Returns a summary message describing the algorithm") - .def("workspaceMethodName", &IAlgorithm::workspaceMethodName, + .def("workspaceMethodName", &IAlgorithm::workspaceMethodName, arg("self"), "Returns a name that will be used when attached as a workspace " "method. Empty string indicates do not attach") - .def("workspaceMethodOn", &IAlgorithm::workspaceMethodOn, + .def("workspaceMethodOn", &IAlgorithm::workspaceMethodOn, arg("self"), return_value_policy<VectorToNumpy>(), // creates a list for strings "Returns a set of class names that will have the method attached. " "Empty list indicates all types") .def("workspaceMethodInputProperty", - &IAlgorithm::workspaceMethodInputProperty, + &IAlgorithm::workspaceMethodInputProperty, arg("self"), "Returns the name of the input workspace property used by the " "calling object") - .def("getAlgorithmID", &getAlgorithmID, + .def("getAlgorithmID", &getAlgorithmID, arg("self"), "Returns a unique identifier for this algorithm object") - .def("docString", &createDocString, + .def("docString", &createDocString, arg("self"), "Returns a doc string for the algorithm") .def("mandatoryProperties", &getInputPropertiesWithMandatoryFirst, + arg("self"), "Returns a list of input and in/out property names that is ordered " "such that the mandatory properties are first followed by the " "optional ones.") - .def("orderedProperties", &getAlgorithmPropertiesOrdered, + .def("orderedProperties", &getAlgorithmPropertiesOrdered, arg("self"), "Return a list of input, in/out and output properties " "such that the mandatory properties are first followed by the " "optional ones.") - .def("outputProperties", &getOutputProperties, + .def("outputProperties", &getOutputProperties, arg("self"), "Returns a list of the output properties on the algorithm") - .def("isInitialized", &IAlgorithm::isInitialized, + .def("isInitialized", &IAlgorithm::isInitialized, arg("self"), "Returns True if the algorithm is initialized, False otherwise") - .def("isExecuted", &IAlgorithm::isExecuted, + .def("isExecuted", &IAlgorithm::isExecuted, arg("self"), "Returns True if the algorithm has been executed successfully, " "False otherwise") - .def("isLogging", &IAlgorithm::isLogging, "Returns True if the " - "algorithm's logger is turned " - "on, False otherwise") - .def("isRunning", &IAlgorithm::isRunning, "Returns True if the algorithm " - "is considered to be running, " - "False otherwise") - .def("setChild", &IAlgorithm::setChild, + .def("isLogging", &IAlgorithm::isLogging, arg("self"), + "Returns True if the " + "algorithm's logger is turned " + "on, False otherwise") + .def("isRunning", &IAlgorithm::isRunning, arg("self"), + "Returns True if the algorithm " + "is considered to be running, " + "False otherwise") + .def("setChild", &IAlgorithm::setChild, (arg("self"), arg("is_child")), "If true this algorithm is run as a child algorithm. There will be " "no logging and nothing is stored in the Analysis Data Service") .def("enableHistoryRecordingForChild", &IAlgorithm::enableHistoryRecordingForChild, + (arg("self"), arg("on")), "If true then history will be recorded regardless of the child " "status") .def("setAlgStartupLogging", &IAlgorithm::setAlgStartupLogging, + (arg("self"), arg("enabled")), "If true then allow logging of start and end messages") .def("getAlgStartupLogging", &IAlgorithm::getAlgStartupLogging, - "Returns true if logging of start and end messages") + arg("self"), "Returns true if logging of start and end messages") .def("setAlwaysStoreInADS", &IAlgorithm::setAlwaysStoreInADS, + (arg("self"), arg("do_store")), "If true then even child algorithms will have their workspaces " "stored in the ADS.") - .def("isChild", &IAlgorithm::isChild, + .def("isChild", &IAlgorithm::isChild, arg("self"), "Returns True if the algorithm has been marked to run as a child. " "If True then Output workspaces " "are NOT stored in the Analysis Data Service but must be retrieved " "from the property.") - .def("setLogging", &IAlgorithm::setLogging, "Toggle logging on/off.") - .def("setRethrows", &IAlgorithm::setRethrows) - .def("initialize", &IAlgorithm::initialize, "Initializes the algorithm") - .def("validateInputs", &IAlgorithm::validateInputs, + .def("setLogging", &IAlgorithm::setLogging, (arg("self"), arg("value")), + "Toggle logging on/off.") + .def("setRethrows", &IAlgorithm::setRethrows, + (arg("self"), arg("rethrow")), "To query whether an algorithm " + "should rethrow exceptions when " + "executing.") + .def("initialize", &IAlgorithm::initialize, arg("self"), + "Initializes the algorithm") + .def("validateInputs", &IAlgorithm::validateInputs, arg("self"), "Cross-check all inputs and return any errors as a dictionary") - .def("execute", &executeProxy, + .def("execute", &executeProxy, arg("self"), "Runs the algorithm and returns whether it has been successful") // 'Private' static methods - .def("_algorithmInThread", &_algorithmInThread) + .def("_algorithmInThread", &_algorithmInThread, arg("thread_id")) .staticmethod("_algorithmInThread") // Special methods - .def("__str__", &IAlgorithm::toString) + .def("__str__", &IAlgorithm::toString, arg("self")) // deprecated methods - .def("getOptionalMessage", &getOptionalMessage, + .def("getOptionalMessage", &getOptionalMessage, arg("self"), "Returns the optional user message attached to the algorithm") - .def("getWikiSummary", &getWikiSummary, + .def("getWikiSummary", &getWikiSummary, arg("self"), "Returns the summary found on the wiki page"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp index c517492f0ac447c26864903f09306b5683a8065a..4805e9a712f33945ff66e444d5968e5cd0d0e139 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp @@ -58,82 +58,96 @@ void export_IFunction() { class_<IFunction, IFunctionAdapter, boost::noncopyable>( "IFunction", "Base class for all functions", no_init) - .def("name", &IFunction::name, "Return the name of the function") + .def("name", &IFunction::name, arg("self"), + "Return the name of the function") - .def("category", &IFunctionAdapter::category, + .def("category", &IFunctionAdapter::category, arg("self"), "Return a semi-colon(;) separated string for the categories this " "class should belong to. For sub-categories use a \\ separator") - .def("initialize", &IFunction::initialize, + .def("initialize", &IFunction::initialize, arg("self"), "Declares any parameters and attributes on the function") - .def("getCategories", &getCategories, + .def("getCategories", &getCategories, arg("self"), "Returns a list of the categories for an algorithm") - .def("nAttributes", &IFunction::nAttributes, + .def("nAttributes", &IFunction::nAttributes, arg("self"), "Return the number of attributes (non-fitting arguments)") - .def("attributeNames", &IFunction::getAttributeNames, + .def("attributeNames", &IFunction::getAttributeNames, arg("self"), "The names of all the attributes") - .def("nParams", &IFunction::nParams, "Return the number of parameters") + .def("nParams", &IFunction::nParams, arg("self"), + "Return the number of parameters") - .def("parameterName", &IFunction::parameterName, + .def("parameterName", &IFunction::parameterName, (arg("self"), arg("i")), "Return the name of the ith parameter") .def("paramDescription", &IFunction::parameterDescription, - "Return a description of the ith parameter") + (arg("self"), arg("i")), "Return a description of the ith parameter") .def("isExplicitlySet", &IFunction::isExplicitlySet, + (arg("self"), arg("i")), "Return whether the ith parameter needs to be explicitely set") .def("getParameterValue", (double (IFunction::*)(size_t) const) & IFunction::getParameter, - "Get the value of the ith parameter") + (arg("self"), arg("i")), "Get the value of the ith parameter") .def("getParameterValue", (double (IFunction::*)(const std::string &) const) & IFunction::getParameter, - "Get the value of the named parameter") + (arg("self"), arg("name")), "Get the value of the named parameter") .def("setParameter", (setParameterType1)&IFunction::setParameter, - setParameterType1_Overloads("Sets the value of the ith parameter")) + setParameterType1_Overloads( + (arg("self"), arg("i"), arg("value"), arg("explicitlySet")), + "Sets the value of the ith parameter")) .def("setParameter", (setParameterType2)&IFunction::setParameter, - setParameterType2_Overloads("Sets the value of the named parameter")) + setParameterType2_Overloads( + (arg("self"), arg("name"), arg("value"), arg("explicitlySet")), + "Sets the value of the named parameter")) .def("declareAttribute", &IFunctionAdapter::declareAttribute, + (arg("self"), arg("name"), arg("default_value")), "Declare an attribute with an initial value") .def("getAttributeValue", (PyObject * (IFunctionAdapter::*)(const std::string &)) & IFunctionAdapter::getAttributeValue, + (arg("self"), arg("name")), "Return the value of the named attribute") .def("declareParameter", &IFunctionAdapter::declareFitParameter, + (arg("self"), arg("name"), arg("init_value"), arg("description")), "Declare a fitting parameter settings its default value & " "description") .def("declareParameter", &IFunctionAdapter::declareFitParameterNoDescr, + (arg("self"), arg("name"), arg("init_value")), "Declare a fitting parameter settings its default value") .def("declareParameter", &IFunctionAdapter::declareFitParameterZeroInit, + (arg("self"), arg("name")), "Declare a fitting parameter settings its default value to 0.0") //-- Deprecated functions that have the wrong names -- - .def("categories", &getCategories, + .def("categories", &getCategories, arg("self"), "Returns a list of the categories for an algorithm") - .def("numParams", &IFunction::nParams, "Return the number of parameters") - .def("getParamName", &IFunction::parameterName, + .def("numParams", &IFunction::nParams, arg("self"), + "Return the number of parameters") + .def("getParamName", &IFunction::parameterName, (arg("self"), arg("i")), "Return the name of the ith parameter") .def("getParamDescr", &IFunction::parameterDescription, - "Return a description of the ith parameter") + (arg("self"), arg("i")), "Return a description of the ith parameter") .def("getParamExplicit", &IFunction::isExplicitlySet, + (arg("self"), arg("i")), "Return whether the ith parameter needs to be explicitely set") .def("getParamValue", (double (IFunction::*)(std::size_t) const) & IFunction::getParameter, - "Get the value of the ith parameter") + (arg("self"), arg("i")), "Get the value of the ith parameter") //-- Python special methods -- - .def("__repr__", &IFunction::asString, + .def("__repr__", &IFunction::asString, arg("self"), "Return a string representation of the function"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp index b610b945ffb3ccb664e1fd82870631607349008c..a435fc7b192eadaad8060c02817d251d5bd2cf59 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp @@ -18,6 +18,7 @@ void export_IFunction1D() { .def("function1D", (object (IFunction1DAdapter::*)(const object &) const) & IFunction1DAdapter::function1D, + (arg("self"), arg("xvals")), "Calculate the values of the function for the given x values and " "returns them"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp index bd69cd0dab31b54c2ede7e5b609a0471b05bdde8..4bd404f62e4b60fe2af7038ce00b91a43326241e 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp @@ -12,15 +12,15 @@ void export_IMDEventWorkspace() { // IMDEventWorkspace class class_<IMDEventWorkspace, bases<IMDWorkspace, MultipleExperimentInfos>, boost::noncopyable>("IMDEventWorkspace", no_init) - .def("getNPoints", &IMDEventWorkspace::getNPoints, + .def("getNPoints", &IMDEventWorkspace::getNPoints, arg("self"), "Returns the total number of points (events) in this workspace") - .def("getNumDims", &IMDEventWorkspace::getNumDims, + .def("getNumDims", &IMDEventWorkspace::getNumDims, arg("self"), "Returns the number of dimensions in this workspace") .def("getBoxController", (BoxController_sptr (IMDEventWorkspace::*)()) & IMDEventWorkspace::getBoxController, - "Returns the BoxController used in this workspace"); + arg("self"), "Returns the BoxController used in this workspace"); RegisterWorkspacePtrToPython<IMDEventWorkspace>(); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp index 3852f7080de7fc94c761795836bf827b22994e65..f64840efaf7bd9f7a3266ade3d528054fdb18aa4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp @@ -167,55 +167,65 @@ void export_IMDHistoWorkspace() { // IMDHistoWorkspace class class_<IMDHistoWorkspace, bases<IMDWorkspace, MultipleExperimentInfos>, boost::noncopyable>("IMDHistoWorkspace", no_init) - .def("getSignalArray", &getSignalArrayAsNumpyArray, + .def("getSignalArray", &getSignalArrayAsNumpyArray, arg("self"), "Returns a read-only numpy array containing the signal values") .def("getErrorSquaredArray", &getErrorSquaredArrayAsNumpyArray, + arg("self"), "Returns a read-only numpy array containing the square of the error " "values") - .def("getNumEventsArray", &getNumEventsArrayAsNumpyArray, + .def("getNumEventsArray", &getNumEventsArrayAsNumpyArray, arg("self"), "Returns a read-only numpy array containing the number of MD events " "in each bin") .def("signalAt", &IMDHistoWorkspace::signalAt, + (arg("self"), arg("index")), return_value_policy<copy_non_const_reference>(), "Return a reference to the signal at the linear index") .def("errorSquaredAt", &IMDHistoWorkspace::errorSquaredAt, + (arg("self"), arg("index")), return_value_policy<copy_non_const_reference>(), "Return the squared-errors at the linear index") .def("setSignalAt", &IMDHistoWorkspace::setSignalAt, + (arg("self"), arg("index"), arg("value")), "Sets the signal at the specified index.") .def("setErrorSquaredAt", &IMDHistoWorkspace::setErrorSquaredAt, + (arg("self"), arg("index"), arg("value")), "Sets the squared-error at the specified index.") .def("setSignalArray", &setSignalArray, + (arg("self"), arg("signalValues")), "Sets the signal from a numpy array. The sizes must match the " "current workspace sizes. A ValueError is thrown if not") - .def("setErrorSquaredArray", &setErrorSquaredArray, + .def("setErrorSquaredArray", &setErrorSquaredArray, arg("self"), "Sets the square of the errors from a numpy array. The sizes must " "match the current workspace sizes. A ValueError is thrown if not") .def("setTo", &IMDHistoWorkspace::setTo, + (arg("self"), arg("signal"), arg("error_squared"), + arg("num_events")), "Sets all signals/errors in the workspace to the given values") .def("getInverseVolume", &IMDHistoWorkspace::getInverseVolume, - return_value_policy<return_by_value>(), + arg("self"), return_value_policy<return_by_value>(), "Return the inverse of volume of EACH cell in the workspace.") .def("getLinearIndex", (size_t (IMDHistoWorkspace::*)(size_t, size_t) const) & IMDHistoWorkspace::getLinearIndex, + (arg("self"), arg("index1"), arg("index2")), return_value_policy<return_by_value>(), "Get the 1D linear index from the 2D array") .def("getLinearIndex", (size_t (IMDHistoWorkspace::*)(size_t, size_t, size_t) const) & IMDHistoWorkspace::getLinearIndex, + (arg("self"), arg("index1"), arg("index2"), arg("index3")), return_value_policy<return_by_value>(), "Get the 1D linear index from the 3D array") @@ -223,10 +233,13 @@ void export_IMDHistoWorkspace() { (size_t (IMDHistoWorkspace::*)(size_t, size_t, size_t, size_t) const) & IMDHistoWorkspace::getLinearIndex, + (arg("self"), arg("index1"), arg("index2"), arg("index3"), + arg("index4")), return_value_policy<return_by_value>(), "Get the 1D linear index from the 4D array") .def("getCenter", &IMDHistoWorkspace::getCenter, + (arg("self"), arg("linear_index")), return_value_policy<return_by_value>(), "Return the position of the center of a bin at a given position"); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMDWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMDWorkspace.cpp index 3c8921df6623a7b4dee6c9abeb6324acb7341798..989089801c34318f3e7087c81f2a3221bd553a33 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDWorkspace.cpp @@ -25,17 +25,17 @@ void export_IMDWorkspace() { // EventWorkspace class class_<IMDWorkspace, bases<Workspace, MDGeometry>, boost::noncopyable>( "IMDWorkspace", no_init) - .def("getNPoints", &IMDWorkspace::getNPoints, args("self"), + .def("getNPoints", &IMDWorkspace::getNPoints, arg("self"), "Returns the total number of points within the workspace") - .def("getNEvents", &IMDWorkspace::getNEvents, args("self"), + .def("getNEvents", &IMDWorkspace::getNEvents, arg("self"), "Returns the total number of events, contributed to the workspace") .def("getSpecialCoordinateSystem", - &IMDWorkspace::getSpecialCoordinateSystem, args("self"), + &IMDWorkspace::getSpecialCoordinateSystem, arg("self"), "Returns the special coordinate system of the workspace") .def("displayNormalization", &IMDWorkspace::displayNormalization, args("self"), "Returns the visual normalization of the workspace.") .def("displayNormalizationHisto", - &IMDWorkspace::displayNormalizationHisto, args("self"), + &IMDWorkspace::displayNormalizationHisto, arg("self"), "For MDEventWorkspaces returns the visual normalization of dervied " "MDHistoWorkspaces." "For all others returns the same as displayNormalization."); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp index 66affb607c0e136f9da7bbfb99b7d421020880b1..7090972a851786d4d7cf28c5e48773cfe1146485 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp @@ -28,12 +28,13 @@ bool isMaskedFromList(const IMaskWorkspace &self, void export_IMaskWorkspace() { class_<IMaskWorkspace, boost::noncopyable>("IMaskWorkspace", no_init) - .def("getNumberMasked", &IMaskWorkspace::getNumberMasked, + .def("getNumberMasked", &IMaskWorkspace::getNumberMasked, arg("self"), "Returns the number of masked pixels in the workspace") .def("isMasked", (bool (IMaskWorkspace::*)(const Mantid::detid_t) const) & IMaskWorkspace::isMasked, + (arg("self"), arg("detector_id")), "Returns whether the given detector ID is masked") - .def("isMasked", isMaskedFromList, + .def("isMasked", isMaskedFromList, (arg("self"), arg("detector_id_list")), "Returns whether all of the given detector ID list are masked"); // register pointers diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp index 13ace3dced290717e05e3ff3888be2e1c5603115..f3e42c14c3f26423d58cb51961c44b632746c78a 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp @@ -36,95 +36,111 @@ void export_IPeak() { register_ptr_to_python<IPeak *>(); class_<IPeak, boost::noncopyable>("IPeak", no_init) - .def("getDetectorID", &IPeak::getDetectorID, + .def("getDetectorID", &IPeak::getDetectorID, arg("self"), "Get the ID of the detector at the center of the peak") - .def("setDetectorID", &IPeak::setDetectorID, + .def("setDetectorID", &IPeak::setDetectorID, (arg("self"), arg("det_id")), "Set the detector ID and look up and cache values related to it.") - .def("getRunNumber", &IPeak::getRunNumber, + .def("getRunNumber", &IPeak::getRunNumber, arg("self"), "Return the run number this peak was measured at") .def("setRunNumber", &IPeak::setRunNumber, + (arg("self"), arg("run_number")), "Set the run number that measured this peak") - .def("getMonitorCount", &IPeak::getMonitorCount, + .def("getMonitorCount", &IPeak::getMonitorCount, arg("self"), "Get the monitor count set for this peak") .def("setMonitorCount", &IPeak::setMonitorCount, + (arg("self"), arg("monitor_count")), "Set the monitor count for this peak") - .def("getH", &IPeak::getH, "Get the H index of the peak") - .def("getK", &IPeak::getK, "Get the K index of the peak") - .def("getL", &IPeak::getL, "Get the L index of the peak") - .def("getHKL", &IPeak::getHKL, "Get HKL as a V3D object") + .def("getH", &IPeak::getH, arg("self"), "Get the H index of the peak") + .def("getK", &IPeak::getK, arg("self"), "Get the K index of the peak") + .def("getL", &IPeak::getL, arg("self"), "Get the L index of the peak") + .def("getHKL", &IPeak::getHKL, arg("self"), "Get HKL as a V3D object") .def("setHKL", (void (IPeak::*)(double, double, double)) & IPeak::setHKL, + (arg("self"), arg("h"), arg("k"), arg("l")), "Set the HKL values of this peak") - .def("setH", &IPeak::setH, "Get the H index of the peak") - .def("setK", &IPeak::setK, "Get the K index of the peak") - .def("setL", &IPeak::setL, "Get the L index of the peak") - .def("getQLabFrame", &IPeak::getQLabFrame, + .def("setH", &IPeak::setH, (arg("self"), arg("h")), + "Get the H index of the peak") + .def("setK", &IPeak::setK, (arg("self"), arg("k")), + "Get the K index of the peak") + .def("setL", &IPeak::setL, (arg("self"), arg("l")), + "Get the L index of the peak") + .def("getQLabFrame", &IPeak::getQLabFrame, arg("self"), "Return the Q change (of the lattice, k_i - k_f) for this peak.\n" "The Q is in the Lab frame: the goniometer rotation was NOT taken " "out.\n" "Note: There is no 2*pi factor used, so \\|Q| = 1/wavelength.") - .def("findDetector", &IPeak::findDetector, + .def("findDetector", &IPeak::findDetector, arg("self"), "Using the instrument set in the peak, perform ray tracing to find " "the exact detector.") - .def("getQSampleFrame", &IPeak::getQSampleFrame, + .def("getQSampleFrame", &IPeak::getQSampleFrame, arg("self"), "Return the Q change (of the lattice, k_i - k_f) for this peak." "The Q is in the Sample frame: the goniometer rotation WAS taken " "out. ") - .def("setQLabFrame", setQLabFrame1, "Set the peak using the peak's " - "position in reciprocal space, in " - "the lab frame.") + .def("setQLabFrame", setQLabFrame1, (arg("self"), arg("qlab_frame")), + "Set the peak using the peak's " + "position in reciprocal space, in " + "the lab frame.") .def("setQLabFrame", setQLabFrame2, + (arg("self"), arg("qlab_frame"), arg("distance")), "Set the peak using the peak's position in reciprocal space, in the " "lab frame. Detector distance explicitly supplied.") // two argument // overload - .def("setQSampleFrame", setQSampleFrame1, "Set the peak using the peak's " + .def("setQSampleFrame", setQSampleFrame1, + (arg("self"), arg("qsample_frame")), "Set the peak using the peak's " "position in reciprocal space, " "in the sample frame.") .def("setQSampleFrame", setQSampleFrame2, + (arg("self"), arg("qsample_frame"), arg("distance")), "Set the peak using the peak's position in reciprocal space, in the " "sample frame. Detector distance explicitly supplied.") .def("setWavelength", &IPeak::setWavelength, + (arg("self"), arg("wave_length")), "Set the incident wavelength of the neutron. Calculates the energy " "from this assuming elastic scattering.") - .def("getWavelength", &IPeak::getWavelength, + .def("getWavelength", &IPeak::getWavelength, arg("self"), "Return the incident wavelength") - .def("getScattering", &IPeak::getScattering, + .def("getScattering", &IPeak::getScattering, arg("self"), "Calculate the scattering angle of the peak") - .def("getDSpacing", &IPeak::getDSpacing, + .def("getDSpacing", &IPeak::getDSpacing, arg("self"), "Calculate the d-spacing of the peak, in 1/Angstroms") - .def("getTOF", &IPeak::getTOF, "Calculate the time of flight (in " - "microseconds) of the neutrons for this " - "peak") - .def("getInitialEnergy", &IPeak::getInitialEnergy, + .def("getTOF", &IPeak::getTOF, arg("self"), + "Calculate the time of flight (in " + "microseconds) of the neutrons for this " + "peak") + .def("getInitialEnergy", &IPeak::getInitialEnergy, arg("self"), "Get the initial (incident) neutron energy") - .def("getFinalEnergy", &IPeak::getFinalEnergy, + .def("getFinalEnergy", &IPeak::getFinalEnergy, arg("self"), "Get the final neutron energy") .def("setInitialEnergy", &IPeak::setInitialEnergy, + (arg("self"), arg("initial_energy")), "Set the initial (incident) neutron energy") .def("setFinalEnergy", &IPeak::setFinalEnergy, - "Set the final neutron energy") - .def("getIntensity", &IPeak::getIntensity, + (arg("self"), arg("final_energy")), "Set the final neutron energy") + .def("getIntensity", &IPeak::getIntensity, arg("self"), "Return the integrated peak intensity") - .def("getSigmaIntensity", &IPeak::getSigmaIntensity, + .def("getSigmaIntensity", &IPeak::getSigmaIntensity, arg("self"), "Return the error on the integrated peak intensity") .def("setIntensity", &IPeak::setIntensity, - "Set the integrated peak intensity") + (arg("self"), arg("intensity")), "Set the integrated peak intensity") .def("setSigmaIntensity", &IPeak::setSigmaIntensity, + (arg("self"), arg("sigma_intensity")), "Set the error on the integrated peak intensity") - .def("getBinCount", &IPeak::getBinCount, + .def("getBinCount", &IPeak::getBinCount, arg("self"), "Return the # of counts in the bin at its peak") - .def("setBinCount", &IPeak::setBinCount, + .def("setBinCount", &IPeak::setBinCount, (arg("self"), arg("bin_count")), "Set the # of counts in the bin at its peak") - .def("getRow", &IPeak::getRow, "For RectangularDetectors only, returns " - "the row (y) of the pixel of the " - "detector.") - .def("getCol", &IPeak::getCol, "For RectangularDetectors only, returns " - "the column (x) of the pixel of the " - "detector.") - .def("getDetPos", &IPeak::getDetPos, + .def("getRow", &IPeak::getRow, arg("self"), + "For RectangularDetectors only, returns " + "the row (y) of the pixel of the " + "detector.") + .def("getCol", &IPeak::getCol, arg("self"), + "For RectangularDetectors only, returns " + "the column (x) of the pixel of the " + "detector.") + .def("getDetPos", &IPeak::getDetPos, arg("self"), "Return the detector position vector") - .def("getL1", &IPeak::getL1, + .def("getL1", &IPeak::getL1, arg("self"), "Return the L1 flight path length (source to sample), in meters. ") - .def("getL2", &IPeak::getL2, + .def("getL2", &IPeak::getL2, arg("self"), "Return the L2 flight path length (sample to detector), in meters.") - .def("getPeakShape", getPeakShape, "Get the peak shape"); + .def("getPeakShape", getPeakShape, arg("self"), "Get the peak shape"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp index f98e84fb8ec7b29d732c1f0626a252e2a9604872..3ac4f6332732a278c3b3ffaa9371cdb41d21edf9 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp @@ -14,11 +14,13 @@ void export_IPeakFunction() { .def("functionLocal", (object (IPeakFunctionAdapter::*)(const object &) const) & IPeakFunction::functionLocal, + (arg("self"), arg("vec_x")), "Calculate the values of the function for the given x values. The " "output should be stored in the out array") - .def("intensity", &IPeakFunction::intensity, + .def("intensity", &IPeakFunction::intensity, arg("self"), "Returns the integral intensity of the peak function.") .def("setIntensity", &IPeakFunction::setIntensity, + (arg("self"), arg("new_intensity")), "Changes the integral intensity of the peak function by setting its " "height."); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp index cedd6732c37158cc1c9d6e074d721bd5203735f8..392d246c8fc1f0b33b63ddbeb98e747aabadd1de 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp @@ -40,29 +40,33 @@ void export_IPeaksWorkspace() { // IPeaksWorkspace class class_<IPeaksWorkspace, bases<ITableWorkspace, ExperimentInfo>, boost::noncopyable>("IPeaksWorkspace", no_init) - .def("getNumberPeaks", &IPeaksWorkspace::getNumberPeaks, + .def("getNumberPeaks", &IPeaksWorkspace::getNumberPeaks, arg("self"), "Returns the number of peaks within the workspace") - .def("addPeak", &IPeaksWorkspace::addPeak, "Add a peak to the workspace") + .def("addPeak", &IPeaksWorkspace::addPeak, (arg("self"), arg("peak")), + "Add a peak to the workspace") .def("removePeak", &IPeaksWorkspace::removePeak, - "Remove a peak from the workspace") + (arg("self"), arg("peak_num")), "Remove a peak from the workspace") .def("getPeak", &IPeaksWorkspace::getPeakPtr, - return_internal_reference<>(), "Returns a peak at the given index") - .def("createPeak", createPeakQLab, + (arg("self"), arg("peak_num")), return_internal_reference<>(), + "Returns a peak at the given index") + .def("createPeak", createPeakQLab, (arg("self"), arg("data")), return_value_policy<manage_new_object>(), "Create a Peak and return it from its coordinates in the QLab frame") .def("createPeak", createPeakQLabWithDistance, + (arg("self"), arg("data"), arg("detector_distance")), return_value_policy<manage_new_object>(), "Create a Peak and return it from its coordinates in the QLab " "frame, detector-sample distance explicitly provided") - .def("createPeakHKL", createPeakHKL, + .def("createPeakHKL", createPeakHKL, (arg("self"), arg("data")), return_value_policy<manage_new_object>(), "Create a Peak and return it from its coordinates in the HKL frame") .def("hasIntegratedPeaks", &IPeaksWorkspace::hasIntegratedPeaks, - "Determine if the peaks have been integrated") - .def("getRun", &IPeaksWorkspace::mutableRun, + arg("self"), "Determine if the peaks have been integrated") + .def("getRun", &IPeaksWorkspace::mutableRun, arg("self"), return_internal_reference<>(), "Return the Run object for this workspace") .def("peakInfoNumber", &IPeaksWorkspace::peakInfoNumber, + (arg("self"), arg("qlab_frame"), arg("lab_coordinate")), "Peak info number at Q vector for this workspace"); //------------------------------------------------------------------------------------------------- diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp index 1e27e7f78036b3a1a341ac103b9f1a0c747bec1f..3afbf36902caa3b24d84fadceb531e4cddd67ca3 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp @@ -12,21 +12,24 @@ void export_ISpectrum() { class_<ISpectrum, boost::noncopyable>("ISpectrum", no_init) .def("hasDetectorID", &ISpectrum::hasDetectorID, + (arg("self"), arg("det_id")), "Returns True if the spectrum contain the given spectrum number") - .def("getSpectrumNo", &ISpectrum::getSpectrumNo, + .def("getSpectrumNo", &ISpectrum::getSpectrumNo, arg("self"), "Returns the spectrum number of this spectrum") .def("getDetectorIDs", (const std::set<detid_t> &(ISpectrum::*)() const) & ISpectrum::getDetectorIDs, - return_value_policy<copy_const_reference>(), + arg("self"), return_value_policy<copy_const_reference>(), "Returns a list of detector IDs for this spectrum") .def("addDetectorID", &ISpectrum::addDetectorID, - "Add a detector ID to this spectrum") + (arg("self"), arg("det_id")), "Add a detector ID to this spectrum") .def("setDetectorID", &ISpectrum::setDetectorID, - "Set the given ID has the only") - .def("clearDetectorIDs", &ISpectrum::clearDetectorIDs, + (arg("self"), arg("det_id")), "Set the given ID has the only") + .def("clearDetectorIDs", &ISpectrum::clearDetectorIDs, arg("self"), "Clear the set of detector IDs") .def("setSpectrumNo", &ISpectrum::setSpectrumNo, + (arg("self"), arg("num")), "Set the spectrum number for this spectrum") - .def("hasDx", &ISpectrum::hasDx, "Returns True if the spectrum uses the " - "DX (X Error) array, else False."); + .def("hasDx", &ISpectrum::hasDx, arg("self"), + "Returns True if the spectrum uses the " + "DX (X Error) array, else False."); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp index 55585283456e84176d06a1bc53b33b0f37a287a1..2ace16a65bb1aac998660d10ba45565d1a2e88c1 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp @@ -11,7 +11,7 @@ void export_ISplittersWorkspace() { class_<ISplittersWorkspace, boost::noncopyable>("ISplittersWorkspace", no_init) .def("getNumberSplitters", &ISplittersWorkspace::getNumberSplitters, - "Returns the number of splitters within the workspace"); + arg("self"), "Returns the number of splitters within the workspace"); // register pointers RegisterWorkspacePtrToPython<ISplittersWorkspace>(); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp index 8280d0fb2512acd690f46edcfa72fcfb2ede005a..853166f3094888aba80258dd77e561a5fbfe564b 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp @@ -338,51 +338,55 @@ void export_ITableWorkspace() { class_<ITableWorkspace, bases<Workspace>, boost::noncopyable>( "ITableWorkspace", iTableWorkspace_docstring.c_str(), no_init) - .def("addColumn", &addColumn, (arg("type"), arg("name")), + .def("addColumn", &addColumn, (arg("self"), arg("type"), arg("name")), "Add a named column with the given type. Recognized types are: " "int,float,double,bool,str,V3D,long64") - .def("removeColumn", &ITableWorkspace::removeColumn, (arg("name")), - "Remove the named column") + .def("removeColumn", &ITableWorkspace::removeColumn, + (arg("self"), arg("name")), "Remove the named column") - .def("columnCount", &ITableWorkspace::columnCount, + .def("columnCount", &ITableWorkspace::columnCount, arg("self"), "Returns the number of columns in the workspace") - .def("rowCount", &ITableWorkspace::rowCount, + .def("rowCount", &ITableWorkspace::rowCount, arg("self"), "Returns the number of rows within the workspace") - .def("setRowCount", &ITableWorkspace::setRowCount, (arg("count")), + .def("setRowCount", &ITableWorkspace::setRowCount, + (arg("self"), arg("count")), "Resize the table to contain count rows") - .def("__len__", &ITableWorkspace::rowCount, + .def("__len__", &ITableWorkspace::rowCount, arg("self"), "Returns the number of rows within the workspace") - .def("getColumnNames", &ITableWorkspace::getColumnNames, + .def("getColumnNames", &ITableWorkspace::getColumnNames, arg("self"), boost::python::return_value_policy<VectorToNumpy>(), "Return a list of the column names") - .def("keys", &ITableWorkspace::getColumnNames, + .def("keys", &ITableWorkspace::getColumnNames, arg("self"), boost::python::return_value_policy<VectorToNumpy>(), "Return a list of the column names") - .def("column", &column, + .def("column", &column, (arg("self"), arg("column")), "Return all values of a specific column as a list") - .def("row", &row, "Return all values of a specific row as a dict") + .def("row", &row, (arg("self"), arg("row")), + "Return all values of a specific row as a dict") - .def("addRow", &addRowFromDict, + .def("addRow", &addRowFromDict, (arg("self"), arg("row_items_dict")), "Appends a row with the values from the dictionary") - .def("addRow", &addRowFromList, + .def("addRow", &addRowFromList, (arg("self"), arg("row_items_list")), "Appends a row with the values from the given list. " "It it assumed that the items are in the correct order for the " "defined columns") - .def("cell", &cell, "Return the given cell. If the first argument is a " - "number then it is interpreted as a row otherwise it " - "is interpreted as a column name") + .def("cell", &cell, (arg("self"), arg("value"), arg("row_or_column")), + "Return the given cell. If the first argument is a " + "number then it is interpreted as a row otherwise it " + "is interpreted as a column name") - .def("setCell", &setCell, + .def("setCell", &setCell, (arg("self"), arg("row_or_column"), + arg("column_or_row"), arg("value")), "Sets the value of a given cell. If the first argument is a " "number then it is interpreted as a row otherwise it is interpreted " "as a column name"); diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp index 525d92c8448be014be0f277607eff7b2593beeb8..8e50a5b573226ff8e8a6707bca688bf8555f6c7b 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp @@ -6,8 +6,8 @@ void export_IWorkspaceProperty() { using Mantid::API::IWorkspaceProperty; class_<IWorkspaceProperty, boost::noncopyable>("IWorkspaceProperty", no_init) - .def("isOptional", &IWorkspaceProperty::isOptional, + .def("isOptional", &IWorkspaceProperty::isOptional, arg("self"), "Is the input workspace property optional") - .def("isLocking", &IWorkspaceProperty::isLocking, + .def("isLocking", &IWorkspaceProperty::isLocking, arg("self"), "Will the workspace be locked when starting an algorithm"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp index 732cae6fca5c6feaec3b64c6d969d5ffbaa4067f..e9d0eb07cfbfb1e91c8151f51e009ff885a90daf 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp @@ -9,11 +9,12 @@ void export_Jacobian() { register_ptr_to_python<Jacobian *>(); class_<Jacobian, boost::noncopyable>("Jacobian", no_init) - .def("set", &Jacobian::set, (arg("iy"), arg("ip"), arg("value")), + .def("set", &Jacobian::set, + (arg("self"), arg("iy"), arg("ip"), arg("value")), "Set an element of the Jacobian matrix where iy=index of data " "point, ip=index of parameter.") - .def("get", &Jacobian::get, (arg("iy"), arg("ip")), + .def("get", &Jacobian::get, (arg("self"), arg("iy"), arg("ip")), "Return the given element of the Jacobian matrix where iy=index of " "data point, ip=index of parameter."); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp index 2c62473353409541efc3e8d1a815ac758c4ad425..c739bc51666f77b172acb054c3266249488ec7d7 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp @@ -35,88 +35,94 @@ boost::python::list getNonIntegratedDimensionsAsPyList(const MDGeometry &self) { void export_MDGeometry() { class_<MDGeometry, boost::noncopyable>("MDGeometry", no_init) - .def("getNumDims", &MDGeometry::getNumDims, + .def("getNumDims", &MDGeometry::getNumDims, arg("self"), "Returns the number of dimensions present") - .def("getDimension", &MDGeometry::getDimension, (args("index")), + .def("getDimension", &MDGeometry::getDimension, + (arg("self"), arg("index")), return_value_policy<RemoveConstSharedPtr>(), "Returns the description of the dimension at the given index " "(starts from 0). Raises RuntimeError if index is out of range.") - .def("getDimensionWithId", &MDGeometry::getDimensionWithId, (args("id")), + .def("getDimensionWithId", &MDGeometry::getDimensionWithId, + (arg("self"), arg("id")), return_value_policy<RemoveConstSharedPtr>(), "Returns the description of the dimension with the given id string. " "Raises ValueError if the string is not a known id.") .def("getDimensionIndexByName", &MDGeometry::getDimensionIndexByName, - (args("name")), "Returns the index of the dimension with the given " - "name. Raises RuntimeError if the name does not " - "exist.") + (arg("self"), arg("name")), + "Returns the index of the dimension with the given " + "name. Raises RuntimeError if the name does not " + "exist.") .def("getDimensionIndexById", &MDGeometry::getDimensionIndexById, - (args("id")), "Returns the index of the dimension with the given " - "ID. Raises RuntimeError if the name does not exist.") + (arg("self"), arg("id")), + "Returns the index of the dimension with the given " + "ID. Raises RuntimeError if the name does not exist.") .def("getNonIntegratedDimensions", &getNonIntegratedDimensionsAsPyList, + arg("self"), "Returns the description objects of the non-integrated dimension as " "a python list of IMDDimension.") - .def("estimateResolution", &MDGeometry::estimateResolution, + .def("estimateResolution", &MDGeometry::estimateResolution, arg("self"), return_value_policy<VectorToNumpy>(), "Returns a numpy array containing the width of the smallest bin in " "each dimension") - .def("getXDimension", &MDGeometry::getXDimension, + .def("getXDimension", &MDGeometry::getXDimension, arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to X") - .def("getYDimension", &MDGeometry::getYDimension, + .def("getYDimension", &MDGeometry::getYDimension, arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to Y") - .def("getZDimension", &MDGeometry::getZDimension, + .def("getZDimension", &MDGeometry::getZDimension, arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to Z") - .def("getTDimension", &MDGeometry::getTDimension, + .def("getTDimension", &MDGeometry::getTDimension, arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to time") - .def("getGeometryXML", &MDGeometry::getGeometryXML, + .def("getGeometryXML", &MDGeometry::getGeometryXML, arg("self"), "Returns an XML representation, as a string, of the geometry of the " "workspace") .def("getBasisVector", (const Mantid::Kernel::VMD &(MDGeometry::*)(size_t) const) & MDGeometry::getBasisVector, - (args("index")), return_value_policy<copy_const_reference>(), + (arg("self"), arg("index")), + return_value_policy<copy_const_reference>(), "Returns a VMD object defining the basis vector for the specified " "dimension") .def("hasOriginalWorkspace", &MDGeometry::hasOriginalWorkspace, - (args("index")), + (arg("self"), arg("index")), "Returns True if there is a source workspace at the given index") .def("numOriginalWorkspaces", &MDGeometry::numOriginalWorkspaces, - "Returns the number of source workspaces attached") + arg("self"), "Returns the number of source workspaces attached") .def("getOriginalWorkspace", &MDGeometry::getOriginalWorkspace, - (args("index")), + (arg("self"), arg("index")), "Returns the source workspace attached at the given index") .def("getOrigin", (const Mantid::Kernel::VMD &(MDGeometry::*)() const) & MDGeometry::getOrigin, - return_value_policy<copy_const_reference>(), + arg("self"), return_value_policy<copy_const_reference>(), "Returns the vector of the origin (in the original workspace) that " "corresponds to 0,0,0... in this workspace") .def("getNumberTransformsFromOriginal", - &MDGeometry::getNumberTransformsFromOriginal, + &MDGeometry::getNumberTransformsFromOriginal, arg("self"), "Returns the number of transformations from original workspace " "coordinate systems") .def("getNumberTransformsToOriginal", - &MDGeometry::getNumberTransformsToOriginal, + &MDGeometry::getNumberTransformsToOriginal, arg("self"), "Returns the number of transformations to original workspace " "coordinate systems") diff --git a/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp index 7be15fa4d6a0798a2911a6bd218c4a2aa7291b6d..fbb754ab25819191b32321b6a3133e9441408f20 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp @@ -157,10 +157,10 @@ void export_MatrixWorkspace() { boost::noncopyable>("MatrixWorkspace", no_init) //--------------------------------------- Meta information //----------------------------------------------------------------------- - .def("blocksize", &MatrixWorkspace::blocksize, args("self"), + .def("blocksize", &MatrixWorkspace::blocksize, arg("self"), "Returns size of the Y data array") .def("getNumberHistograms", &MatrixWorkspace::getNumberHistograms, - args("self"), "Returns the number of spectra in the workspace") + arg("self"), "Returns the number of spectra in the workspace") .def("binIndexOf", &MatrixWorkspace::binIndexOf, MatrixWorkspace_binIndexOfOverloads( (arg("self"), arg("xvalue"), arg("workspaceIndex")), @@ -168,73 +168,79 @@ void export_MatrixWorkspace() { "workspace_index is optional [default=0]")) .def("detectorTwoTheta", (getDetectorSignature)&MatrixWorkspace::detectorTwoTheta, - args("self", "det"), + (arg("self"), arg("det")), "Returns the two theta value for a given detector") .def("detectorSignedTwoTheta", (getDetectorSignature)&MatrixWorkspace::detectorSignedTwoTheta, - args("self", "det"), + (arg("self"), arg("det")), "Returns the signed two theta value for given detector") .def("getSpectrum", (ISpectrum * (MatrixWorkspace::*)(const size_t)) & MatrixWorkspace::getSpectrum, - return_internal_reference<>(), args("self", "workspaceIndex"), + (arg("self"), arg("workspaceIndex")), return_internal_reference<>(), "Return the spectra at the given workspace index.") .def("getIndexFromSpectrumNumber", - &MatrixWorkspace::getIndexFromSpectrumNumber, args("self"), + &MatrixWorkspace::getIndexFromSpectrumNumber, + (arg("self"), arg("spec_no")), "Returns workspace index correspondent to the given spectrum " "number. Throws if no such spectrum is present in the workspace") .def("getDetector", &MatrixWorkspace::getDetector, return_value_policy<RemoveConstSharedPtr>(), - args("self", "workspaceIndex"), "Return the Detector or " - "DetectorGroup that is linked to " - "the given workspace index") - .def("getRun", &MatrixWorkspace::mutableRun, - return_internal_reference<>(), args("self"), + (arg("self"), arg("workspaceIndex")), + "Return the Detector or " + "DetectorGroup that is linked to " + "the given workspace index") + .def("getRun", &MatrixWorkspace::mutableRun, arg("self"), + return_internal_reference<>(), "Return the Run object for this workspace") - .def("axes", &MatrixWorkspace::axes, args("self"), + .def("axes", &MatrixWorkspace::axes, arg("self"), "Returns the number of axes attached to the workspace") - .def("getAxis", &MatrixWorkspace::getAxis, return_internal_reference<>(), - args("self", "axis_index")) - .def("isHistogramData", &MatrixWorkspace::isHistogramData, args("self"), + .def("getAxis", &MatrixWorkspace::getAxis, + (arg("self"), arg("axis_index")), return_internal_reference<>(), + "Get a pointer to a workspace axis") + .def("isHistogramData", &MatrixWorkspace::isHistogramData, arg("self"), "Returns True if this is considered to be binned data.") .def("isDistribution", (const bool &(MatrixWorkspace::*)() const) & MatrixWorkspace::isDistribution, - return_value_policy<copy_const_reference>(), args("self"), + arg("self"), return_value_policy<copy_const_reference>(), "Returns the status of the distribution flag") - .def("YUnit", &MatrixWorkspace::YUnit, args("self"), + .def("YUnit", &MatrixWorkspace::YUnit, arg("self"), "Returns the current Y unit for the data (Y axis) in the workspace") - .def("YUnitLabel", &MatrixWorkspace::YUnitLabel, args("self"), + .def("YUnitLabel", &MatrixWorkspace::YUnitLabel, arg("self"), "Returns the caption for the Y axis") // Deprecated - .def("getNumberBins", &getNumberBinsDeprecated, args("self"), + .def("getNumberBins", &getNumberBinsDeprecated, arg("self"), "Returns size of the Y data array (deprecated, use blocksize " "instead)") - .def("getSampleDetails", &getSampleDetailsDeprecated, - return_internal_reference<>(), args("self"), + .def("getSampleDetails", &getSampleDetailsDeprecated, arg("self"), + return_internal_reference<>(), "Return the Run object for this workspace (deprecated, use getRun " "instead)") //--------------------------------------- Setters //------------------------------------ .def("setYUnitLabel", &MatrixWorkspace::setYUnitLabel, - args("self", "newLabel"), + (arg("self"), arg("newLabel")), "Sets a new caption for the data (Y axis) in the workspace") - .def("setYUnit", &MatrixWorkspace::setYUnit, args("self", "newUnit"), + .def("setYUnit", &MatrixWorkspace::setYUnit, + (arg("self"), arg("newUnit")), "Sets a new unit for the data (Y axis) in the workspace") .def("setDistribution", (bool &(MatrixWorkspace::*)(const bool)) & MatrixWorkspace::isDistribution, - return_value_policy<return_by_value>(), args("self", "newVal"), + (arg("self"), arg("newVal")), return_value_policy<return_by_value>(), "Set distribution flag. If True the workspace has been divided by " "the bin-width.") .def("replaceAxis", &MatrixWorkspace::replaceAxis, - args("self", "axisIndex", "newAxis")) + (arg("self"), arg("axisIndex"), arg("newAxis")), + "Replaces one of the workspace's axes with the new one provided.") //--------------------------------------- Read spectrum data //------------------------- - .def("readX", &MatrixWorkspace::readX, return_readonly_numpy(), - args("self", "workspaceIndex"), "Creates a read-only numpy wrapper " - "around the original X data at the " - "given index") + .def("readX", &MatrixWorkspace::readX, + (arg("self"), arg("workspaceIndex")), return_readonly_numpy(), + "Creates a read-only numpy wrapper " + "around the original X data at the " + "given index") .def("readY", &MatrixWorkspace::readY, return_readonly_numpy(), args("self", "workspaceIndex"), "Creates a read-only numpy wrapper " "around the original Y data at the " diff --git a/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp index e1ee933671887581dcfb37ed06065f2045ba4643..1635dd5d4cc22a15a23e6c5c364668734bbd86f4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp @@ -12,8 +12,9 @@ void export_MultipleExperimentInfos() { .def("getExperimentInfo", (ExperimentInfo_sptr (MultipleExperimentInfos::*)(const uint16_t)) & MultipleExperimentInfos::getExperimentInfo, + (arg("self"), arg("run_index")), "Return the experiment info at the given index.") .def("getNumExperimentInfo", - &MultipleExperimentInfos::getNumExperimentInfo, + &MultipleExperimentInfos::getNumExperimentInfo, arg("self"), "Return the number of experiment info objects,"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp index 080bed5db9c13e75709f93e262432f96f35f05b7..0973bf8190b35b423e6065bea29cadcf4c3531e4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp @@ -114,21 +114,23 @@ void export_Projection() { "of u and v.") .def("__init__", make_constructor(&projCtor3), "Constructs a 3 dimensional projection") - .def("getOffset", &Projection::getOffset, + .def("getOffset", &Projection::getOffset, (arg("self"), arg("nd")), "Returns the offset for the given dimension", args("dimension")) - .def("getAxis", &Projection::getAxis, + .def("getAxis", &Projection::getAxis, (arg("self"), arg("nd")), "Returns the axis for the given dimension", args("dimension")) - .def("getType", &getUnit, "Returns the unit for the given dimension", - args("dimension")) + .def("getType", &getUnit, (arg("self"), arg("dimension")), + "Returns the unit for the given dimension") .def("setOffset", &Projection::setOffset, + (arg("self"), arg("nd"), arg("offset")), "Sets the offset for the given dimension", args("dimension", "offset")) .def("setAxis", &Projection::setAxis, - "Sets the axis for the given dimension", args("dimension", "axis")) - .def("setAxis", &projSetAxis, "Sets the axis for the given dimension", - args("dimension", "axis")) - .def("setType", &setUnit, "Sets the unit for the given dimension", - args("dimension", "unit")) + (arg("self"), arg("dimension"), arg("axis")), + "Sets the axis for the given dimension") + .def("setAxis", &projSetAxis, (arg("self"), arg("nd"), arg("data")), + "Sets the axis for the given dimension") + .def("setType", &setUnit, (arg("self"), arg("dimension"), arg("unit")), + "Sets the unit for the given dimension") .add_property( "u", make_function(&Projection::U, return_internal_reference<>(), boost::mpl::vector2<V3D &, Projection &>()), diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp index 8f8548bbcc57f1bd0fc0ca70815263ec4b454a43..bc950c6e2ff6754c95539fd6a278f394a995040d 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp @@ -116,67 +116,77 @@ void export_Run() { // Run class class_<Run, boost::noncopyable>("Run", no_init) - .def("getProtonCharge", &Run::getProtonCharge, + .def("getProtonCharge", &Run::getProtonCharge, arg("self"), "Return the total good proton charge for the run") - .def("integrateProtonCharge", &Run::integrateProtonCharge, + .def("integrateProtonCharge", &Run::integrateProtonCharge, arg("self"), "Return the total good proton charge for the run") - .def("hasProperty", &Run::hasProperty, + .def("hasProperty", &Run::hasProperty, (arg("self"), arg("name")), "Returns True if the given log value is contained within the run") - .def("getProperty", &Run::getProperty, + .def("getProperty", &Run::getProperty, (arg("self"), arg("name")), return_value_policy<return_by_value>(), "Returns the named property " "(log value). Use '.value' " "to return the value.") - .def("getProperties", &Run::getProperties, return_internal_reference<>(), + .def("getProperties", &Run::getProperties, arg("self"), + return_internal_reference<>(), "Return the list of run properties managed by this object.") .def("getLogData", (Property * (Run::*)(const std::string &) const) & Run::getLogData, - return_value_policy<return_by_value>(), + (arg("self"), arg("name")), return_value_policy<return_by_value>(), "Returns the named log. Use '.value' to return the value. The same " "as getProperty.") .def("getLogData", (const std::vector<Property *> &(Run::*)() const) & Run::getLogData, - return_internal_reference<>(), + arg("self"), return_internal_reference<>(), "Return the list of logs for this run. The same as getProperties.") .def("getGoniometer", (const Mantid::Geometry::Goniometer &(Run::*)() const) & Run::getGoniometer, - return_value_policy<reference_existing_object>(), + arg("self"), return_value_policy<reference_existing_object>(), "Get the oriented lattice for this sample") - .def("addProperty", &addProperty, "Adds a property with the given name " - "and value. If replace=True then an " - "existing property is overwritten") + .def("addProperty", &addProperty, + (arg("self"), arg("name"), arg("value"), arg("replace")), + "Adds a property with the given name " + "and value. If replace=True then an " + "existing property is overwritten") .def("addProperty", &addPropertyWithUnit, + (arg("self"), arg("name"), arg("value"), arg("units"), + arg("replace")), "Adds a property with the given name, value and unit. If " "replace=True then an existing property is overwritten") .def("setStartAndEndTime", &Run::setStartAndEndTime, + (arg("self"), arg("start"), arg("end")), "Set the start and end time of the run") - .def("startTime", &Run::startTime, + .def("startTime", &Run::startTime, arg("self"), "Return the total starting time of the run.") - .def("endTime", &Run::endTime, "Return the total ending time of the run.") + .def("endTime", &Run::endTime, arg("self"), + "Return the total ending time of the run.") //--------------------------- Dictionary // access---------------------------- - .def("get", &getWithDefault, "Returns the value pointed to by the key or " - "None if it does not exist") - .def("get", &get, + .def("get", &getWithDefault, (arg("self"), arg("key"), arg("default")), + "Returns the value pointed to by the key or " + "None if it does not exist") + .def("get", &get, (arg("self"), arg("key")), "Returns the value pointed to by the key or the default value given") - .def("keys", &keys, "Returns the names of the properties as list") - .def("__contains__", &Run::hasProperty) - .def("__getitem__", &Run::getProperty, + .def("keys", &keys, arg("self"), + "Returns the names of the properties as list") + .def("__contains__", &Run::hasProperty, (arg("self"), arg("name"))) + .def("__getitem__", &Run::getProperty, (arg("self"), arg("name")), return_value_policy<return_by_value>()) - .def("__setitem__", &addOrReplaceProperty) + .def("__setitem__", &addOrReplaceProperty, + (arg("self"), arg("name"), arg("value"))) ; } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp index cbf45afe13a4c246126189710d15d03a218f85e2..baa9826478dbad9a4c9ee7b2065d468a7cfedf01 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp @@ -16,35 +16,41 @@ void export_Sample() { class_<Sample, boost::noncopyable>("Sample", no_init) .def("getName", &Sample::getName, - return_value_policy<copy_const_reference>(), + return_value_policy<copy_const_reference>(), arg("self"), "Returns the string name of the sample") .def("getOrientedLattice", (const OrientedLattice &(Sample::*)() const) & Sample::getOrientedLattice, - return_value_policy<reference_existing_object>(), + arg("self"), return_value_policy<reference_existing_object>(), "Get the oriented lattice for this sample") - .def("hasOrientedLattice", &Sample::hasOrientedLattice, + .def("hasOrientedLattice", &Sample::hasOrientedLattice, arg("self"), "Returns True if this sample has an oriented lattice, false " "otherwise") - .def("size", &Sample::size, + .def("size", &Sample::size, arg("self"), "Return the number of samples contained within this sample") // Required for ISIS SANS reduction until the full sample geometry is // defined on loading - .def("getGeometryFlag", &Sample::getGeometryFlag, + .def("getGeometryFlag", &Sample::getGeometryFlag, arg("self"), "Return the geometry flag.") - .def("getThickness", &Sample::getThickness, "Return the thickness in mm") - .def("getHeight", &Sample::getHeight, "Return the height in mm") - .def("getWidth", &Sample::getWidth, "Return the width in mm") + .def("getThickness", &Sample::getThickness, arg("self"), + "Return the thickness in mm") + .def("getHeight", &Sample::getHeight, arg("self"), + "Return the height in mm") + .def("getWidth", &Sample::getWidth, arg("self"), "Return the width in mm") .def("getMaterial", (const Material &(Sample::*)() const)(&Sample::getMaterial), - return_value_policy<reference_existing_object>(), + arg("self"), return_value_policy<reference_existing_object>(), "The material the sample is composed of") .def("setGeometryFlag", &Sample::setGeometryFlag, - "Set the geometry flag.") - .def("setThickness", &Sample::setThickness, "Set the thickness in mm.") - .def("setHeight", &Sample::setHeight, "Set the height in mm.") - .def("setWidth", &Sample::setWidth, "Set the width in mm.") + (arg("self"), arg("geom_id")), "Set the geometry flag.") + .def("setThickness", &Sample::setThickness, (arg("self"), arg("thick")), + "Set the thickness in mm.") + .def("setHeight", &Sample::setHeight, (arg("self"), arg("height")), + "Set the height in mm.") + .def("setWidth", &Sample::setWidth, (arg("self"), arg("width")), + "Set the width in mm.") // -------------------------Operators // ------------------------------------- - .def("__len__", &Sample::size) + .def("__len__", &Sample::size, arg("self"), + "Gets the number of samples in this collection") .def("__getitem__", &Sample::operator[], return_internal_reference<>()); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepository.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepository.cpp index 91979d2a4981d49db39845bc3dc316c1bd95b463..2422b6c7a81b3dace66d938011db87ac2ac29173 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepository.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepository.cpp @@ -196,11 +196,15 @@ Arguments:\n\ ///@todo better description class_<ScriptRepository, boost::noncopyable>("ScriptRepository", repo_desc, no_init) - .def("install", &ScriptRepository::install, install_desc) - .def("listFiles", &getListFiles, list_files_desc) - .def("fileInfo", &getInfo, file_info_desc) - .def("description", &getDescription, file_description_desc) - .def("fileStatus", &getStatus, file_status_desc) - .def("download", &ScriptRepository::download, download_desc) - .def("update", &ScriptRepository::check4Update, update_desc); + .def("install", &ScriptRepository::install, + (arg("self"), arg("local_path")), install_desc) + .def("listFiles", &getListFiles, arg("self"), list_files_desc) + .def("fileInfo", &getInfo, (arg("self"), arg("path")), file_info_desc) + .def("description", &getDescription, (arg("self"), arg("path")), + file_description_desc) + .def("fileStatus", &getStatus, (arg("self"), arg("path")), + file_status_desc) + .def("download", &ScriptRepository::download, + (arg("self"), arg("file_path")), download_desc) + .def("update", &ScriptRepository::check4Update, arg("self"), update_desc); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepositoryFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepositoryFactory.cpp index 0f572e8bf639040dd0f7d8e74c9347f270ee083d..91eef3e80418280995943a92161a2537dded62a9 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepositoryFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepositoryFactory.cpp @@ -19,6 +19,7 @@ void export_ScriptRepositoryFactory() { class_<ScriptRepositoryFactoryImpl, boost::noncopyable>( "ScriptRepositoryFactory", no_init) .def("create", &ScriptRepositoryFactoryImpl::create, + (arg("self"), arg("class_name")), "Return a pointer to the ScriptRepository object") .def("Instance", &ScriptRepositoryFactory::Instance, return_value_policy<reference_existing_object>(), diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp index e1943cc6a740d1e21760b84822ac78d760d4f4ff..a399b9ca775cb9cdad79cff7a4b904cef7f48692 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp @@ -30,24 +30,27 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Workspace_isDirtyOverloads, void export_Workspace() { class_<Workspace, bases<DataItem>, boost::noncopyable>("Workspace", no_init) .def("getName", &Workspace::getName, - return_value_policy<copy_const_reference>(), args("self"), + return_value_policy<copy_const_reference>(), arg("self"), "Returns the name of the workspace. This could be an empty string") - .def("getTitle", &Workspace::getTitle, args("self"), + .def("getTitle", &Workspace::getTitle, arg("self"), "Returns the title of the workspace") - .def("setTitle", &Workspace::setTitle, args("self", "title")) - .def("getComment", &Workspace::getComment, + .def("setTitle", &Workspace::setTitle, (arg("self"), arg("title")), + "Set the title of the workspace") + .def("getComment", &Workspace::getComment, arg("self"), return_value_policy<copy_const_reference>(), "Returns the comment field on the workspace") - .def("setComment", &Workspace::setComment, args("self", "comment")) + .def("setComment", &Workspace::setComment, (arg("self"), arg("comment")), + "Set the comment field of the workspace") .def("isDirty", &Workspace::isDirty, - Workspace_isDirtyOverloads(arg("n"), "True if the workspace has run " - "more than n algorithms " - "(Default=1)")) - .def("getMemorySize", &Workspace::getMemorySize, args("self"), + Workspace_isDirtyOverloads((arg("self"), arg("n")), + "True if the workspace has run " + "more than n algorithms " + "(Default=1)")) + .def("getMemorySize", &Workspace::getMemorySize, arg("self"), "Returns the memory footprint of the workspace in KB") .def("getHistory", (const WorkspaceHistory &(Workspace::*)() const) & Workspace::getHistory, - return_value_policy<reference_existing_object>(), args("self"), + arg("self"), return_value_policy<reference_existing_object>(), "Return read-only access to the workspace history"); // register pointers diff --git a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp index 0057a3ea6089e7908683974b8db845216dbd06b2..94373c2f9d16a87446c5864760cd9c88aa1aeea8 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp @@ -70,22 +70,26 @@ void export_WorkspaceFactory() { class_<WorkspaceFactoryImpl, boost::noncopyable>("WorkspaceFactoryImpl", no_init) .def("create", &createFromParentPtr, - createFromParent_Overload( - createFromParentDoc, (arg("parent"), arg("NVectors") = -1, - arg("XLength") = -1, arg("YLength") = -1))) + createFromParent_Overload(createFromParentDoc, + (arg("self"), arg("parent"), + arg("NVectors") = -1, arg("XLength") = -1, + arg("YLength") = -1))) .def("create", (createFromScratchPtr)&WorkspaceFactoryImpl::create, createFromScratchDoc, return_value_policy<AsType<Workspace_sptr>>(), - (arg("className"), arg("NVectors"), arg("XLength"), arg("YLength"))) + (arg("self"), arg("className"), arg("NVectors"), arg("XLength"), + arg("YLength"))) .def("createTable", &WorkspaceFactoryImpl::createTable, - createTable_Overload("Creates an empty TableWorkspace", - (arg("className") = "TableWorkspace")) + createTable_Overload( + "Creates an empty TableWorkspace", + (arg("self"), arg("className") = "TableWorkspace")) [return_value_policy<AsType<Workspace_sptr>>()]) .def("createPeaks", &WorkspaceFactoryImpl::createPeaks, - createPeaks_Overload("Creates an empty PeaksWorkspace", - (arg("className") = "PeaksWorkspace")) + createPeaks_Overload( + "Creates an empty PeaksWorkspace", + (arg("self"), arg("className") = "PeaksWorkspace")) [return_value_policy<AsType<Workspace_sptr>>()]) .def("Instance", &WorkspaceFactory::Instance, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroup.cpp b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroup.cpp index 702a7fe490a02376198838b30531fd34f70347cd..8c15d0331d17f326bcc93695ee46b4d083c8f017 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroup.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroup.cpp @@ -13,22 +13,26 @@ void export_WorkspaceGroup() { class_<WorkspaceGroup, bases<Workspace>, boost::noncopyable>("WorkspaceGroup", no_init) .def("getNumberOfEntries", &WorkspaceGroup::getNumberOfEntries, - "Returns the number of entries in the group") - .def("getNames", &WorkspaceGroup::getNames, + arg("self"), "Returns the number of entries in the group") + .def("getNames", &WorkspaceGroup::getNames, arg("self"), "Returns the names of the entries in the group") .def("contains", (bool (WorkspaceGroup::*)(const std::string &wsName) const) & WorkspaceGroup::contains, + (arg("self"), arg("workspace")), "Returns true if the given name is in the group") - .def("add", &WorkspaceGroup::add, "Add a name to the group") - .def("size", &WorkspaceGroup::size, + .def("add", &WorkspaceGroup::add, (arg("self"), arg("workspace_name")), + "Add a name to the group") + .def("size", &WorkspaceGroup::size, arg("self"), "Returns the number of workspaces contained in the group") - .def("remove", &WorkspaceGroup::remove, "Remove a name from the group") + .def("remove", &WorkspaceGroup::remove, + (arg("self"), arg("workspace_name")), "Remove a name from the group") .def("getItem", (Workspace_sptr (WorkspaceGroup::*)(const size_t) const) & WorkspaceGroup::getItem, + (arg("self"), arg("workspace_name")), return_value_policy<Policies::ToWeakPtr>(), "Returns the item at the given index") - .def("isMultiPeriod", &WorkspaceGroup::isMultiperiod, + .def("isMultiPeriod", &WorkspaceGroup::isMultiperiod, arg("self"), "Retuns true if the workspace group is multi-period") // ------------ Operators -------------------------------- .def("__len__", &WorkspaceGroup::getNumberOfEntries) diff --git a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceHistory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceHistory.cpp index ad3133315cf8f163ccbd0f643d94ee004166d8d1..9a32321b85fe93b711c88e770ae089e673720b86 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceHistory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceHistory.cpp @@ -38,27 +38,31 @@ void export_WorkspaceHistory() { class_<WorkspaceHistory, boost::noncopyable>("WorkspaceHistory", no_init) - .def("getAlgorithmHistories", &getHistoriesAsList, + .def("getAlgorithmHistories", &getHistoriesAsList, arg("self"), "Returns a list of algorithm histories for this workspace history.") .def("getAlgorithmHistory", &WorkspaceHistory::getAlgorithmHistory, - arg("index"), return_value_policy<Policies::RemoveConstSharedPtr>(), + (arg("self"), arg("index")), + return_value_policy<Policies::RemoveConstSharedPtr>(), "Returns the algorithm history at the given index in the history") - .def("size", &WorkspaceHistory::size, + .def("size", &WorkspaceHistory::size, arg("self"), "Returns the number of algorithms in the immediate history") - .def("empty", &WorkspaceHistory::empty, + .def("empty", &WorkspaceHistory::empty, arg("self"), "Returns whether the history has any entries") - .def("lastAlgorithm", &WorkspaceHistory::lastAlgorithm, + .def("lastAlgorithm", &WorkspaceHistory::lastAlgorithm, arg("self"), "Returns the last algorithm run on this workspace so that its " "properties can be accessed") .def("getAlgorithm", &WorkspaceHistory::getAlgorithm, + (arg("self"), arg("index")), "Returns the algorithm at the given index in the history") // ----------------- Operators -------------------------------------- - .def("__getitem__", &WorkspaceHistory::getAlgorithm) + .def("__getitem__", &WorkspaceHistory::getAlgorithm, + (arg("self"), arg("index")), + "Create an algorithm from a history record at a given index") .def(self_ns::str(self)); }