Skip to content
Snippets Groups Projects
Commit ca3eb13a authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Refs #13692. Reduced to 143 warnings.

parent 977c7cd1
No related merge requests found
Showing
with 107 additions and 18 deletions
......@@ -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
......
......@@ -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,
......
......@@ -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));
......
......@@ -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
......
......@@ -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");
}
......@@ -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");
......
......@@ -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,
......
......@@ -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")
......
......@@ -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");
}
......@@ -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");
}
......@@ -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")),
......
......@@ -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");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment