From ca3eb13aa8c1e666cfd83bc3f7ea1b2869bb5cf1 Mon Sep 17 00:00:00 2001 From: Wenduo Zhou <zhouw@ornl.gov> Date: Tue, 13 Oct 2015 22:00:47 -0400 Subject: [PATCH] Refs #13692. Reduced to 143 warnings. --- .../mantid/api/src/Exports/Algorithm.cpp | 1 + .../api/src/Exports/AlgorithmFactory.cpp | 6 +++- .../api/src/Exports/AlgorithmHistory.cpp | 20 ++++++++--- .../api/src/Exports/AlgorithmManager.cpp | 8 +++++ .../mantid/api/src/Exports/BoxController.cpp | 13 ++++++- .../src/Exports/DataProcessorAlgorithm.cpp | 15 +++++++- .../api/src/Exports/FrameworkManager.cpp | 8 +++++ .../api/src/Exports/FunctionFactory.cpp | 5 ++- .../mantid/api/src/Exports/IAlgorithm.cpp | 34 +++++++++++++++---- .../mantid/api/src/Exports/IFunction.cpp | 10 +++++- .../mantid/api/src/Exports/IPeakFunction.cpp | 3 +- .../api/src/Exports/IWorkspaceProperty.cpp | 2 ++ 12 files changed, 107 insertions(+), 18 deletions(-) diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp index 41ef7653cab..2ebe6a155f3 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp @@ -121,6 +121,7 @@ void export_leaf_classes() { // 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 48b38115527..4aa463269f8 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp @@ -118,11 +118,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 " + .def("subscribe", &subscribe, + (arg("self"), arg("object")), + "Register a Python class derived from " "PythonAlgorithm into the factory") .def("Instance", &AlgorithmFactory::Instance, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp index 8c886db7e8e..e0778ad2d26 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp @@ -59,39 +59,49 @@ void export_AlgorithmHistory() { class_<AlgorithmHistory>("AlgorithmHistory", no_init) .def("name", &AlgorithmHistory::name, + arg("self"), return_value_policy<copy_const_reference>(), "Returns the name of the algorithm.") .def("version", &AlgorithmHistory::version, + arg("self"), return_value_policy<copy_const_reference>(), "Returns the version of the algorithm.") .def("executionDuration", &AlgorithmHistory::executionDuration, + arg("self"), "Returns the execution duration of the algorithm.") .def("executionDate", &AlgorithmHistory::executionDate, + arg("self"), "Returns the execution date of the algorithm.") .def("execCount", &AlgorithmHistory::execCount, + arg("self"), return_value_policy<copy_const_reference>(), "Returns the execution number of the algorithm.") .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, + 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 f827fd3728b..d31a131fe26 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp @@ -79,21 +79,29 @@ void export_AlgorithmManager() { createUnmanaged_overloads((arg("name"), arg("version")), "Creates an unmanaged algorithm.")) .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, + (arg("self"), arg("id_holder")), "Return the algorithm instance identified by the given id.") .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, + arg("self"), "Clears the current list of managed algorithms") .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/BoxController.cpp b/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp index 7caf592a3ea..35b0b67d837 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/BoxController.cpp @@ -11,24 +11,35 @@ 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("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, + 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, + arg("self"), "Return the average recursion depth of gridding.") .def("isFileBacked", &BoxController::isFileBacked, + arg("self"), "Return True if the MDEventWorkspace is backed by a file ") .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, + 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 1dacf9c7bc5..2f9350e4ae7 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp @@ -25,39 +25,48 @@ 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, + (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, + (arg("self"), arg("input")), return_value_policy<VectorToNumpy>()) - .def("forwardProperties", &DataProcessorAdapter::forwardPropertiesProxy) + .def("forwardProperties", &DataProcessorAdapter::forwardPropertiesProxy, + arg("self")) .def("getProcessProperties", &DataProcessorAdapter::getProcessPropertiesProxy, @@ -65,21 +74,25 @@ void export_DataProcessorAlgorithm() { "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, + 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/FrameworkManager.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp index 1e31d32096f..1203f15ca02 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FrameworkManager.cpp @@ -13,30 +13,38 @@ void export_FrameworkManager() { no_init) .def("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, + 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, + arg("self"), "Clear memory held by the data service (essentially all workspaces, " "including hidden)") .def("clearInstruments", &FrameworkManagerImpl::clearInstruments, + arg("self"), "Clear memory held by the cached instruments") .def("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 2d94e8f7aea..f5c103bca4b 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FunctionFactory.cpp @@ -90,14 +90,17 @@ void export_FunctionFactory() { class_<FunctionFactoryImpl, boost::noncopyable>("FunctionFactoryImpl", no_init) .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, + (arg("self"), arg("object")), "Register a Python class derived from IFunction into the factory") .def("unsubscribe", &FunctionFactoryImpl::unsubscribe, + (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 f70cc834983..2bf8059cae0 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp @@ -340,46 +340,64 @@ void export_ialgorithm() { "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, + arg("self"), "Returns a list of the output properties on the algorithm") .def("isInitialized", &IAlgorithm::isInitialized, + arg("self"), "Returns True if the algorithm is initialized, False otherwise") .def("isExecuted", &IAlgorithm::isExecuted, + arg("self"), "Returns True if the algorithm has been executed successfully, " "False otherwise") .def("isLogging", &IAlgorithm::isLogging, arg("self"), "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("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, + 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, + 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("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, + arg("self"), "Runs the algorithm and returns whether it has been successful") // 'Private' static methods .def("_algorithmInThread", &_algorithmInThread) @@ -389,7 +407,9 @@ void export_ialgorithm() { // deprecated methods .def("getOptionalMessage", &getOptionalMessage, + arg("self"), "Returns the optional user message attached to the algorithm") .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 9e7b21eb69d..f755085d7fe 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp @@ -123,18 +123,26 @@ void export_IFunction() { //-- Deprecated functions that have the wrong names -- .def("categories", &getCategories, + arg("self"), "Returns a list of the categories for an algorithm") - .def("numParams", &IFunction::nParams, "Return the number of parameters") + .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, + (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, + (arg("self"), arg("i")), "Get the value of the ith parameter") //-- Python special methods -- .def("__repr__", &IFunction::asString, + arg("self"), "Return a string representation of the function"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp index 3ac4f633273..0c0c19486ea 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp @@ -17,7 +17,8 @@ void export_IPeakFunction() { (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, arg("self"), + .def("intensity", &IPeakFunction::intensity, + arg("self"), "Returns the integral intensity of the peak function.") .def("setIntensity", &IPeakFunction::setIntensity, (arg("self"), arg("new_intensity")), diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp index 525d92c8448..08baa602526 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IWorkspaceProperty.cpp @@ -7,7 +7,9 @@ void export_IWorkspaceProperty() { class_<IWorkspaceProperty, boost::noncopyable>("IWorkspaceProperty", no_init) .def("isOptional", &IWorkspaceProperty::isOptional, + arg("self"), "Is the input workspace property optional") .def("isLocking", &IWorkspaceProperty::isLocking, + arg("self"), "Will the workspace be locked when starting an algorithm"); } -- GitLab