From 48fc951aa6afe0f6996c60f99040f5aa2743523c Mon Sep 17 00:00:00 2001 From: Wenduo Zhou <zhouw@ornl.gov> Date: Wed, 14 Oct 2015 15:29:53 -0400 Subject: [PATCH] Refs #13692. Downsized to 46. --- .../api/WorkspacePropertyExporter.h | 3 ++- .../kernel/DataServiceExporter.h | 26 ++++++++++++++----- .../kernel/TypedValidatorExporter.h | 1 + .../mantid/api/src/Exports/Algorithm.cpp | 6 ++--- .../mantid/api/src/Exports/Axis.cpp | 15 +++++++---- .../src/Exports/DataProcessorAlgorithm.cpp | 1 + .../mantid/api/src/Exports/FileFinder.cpp | 3 ++- .../api/src/Exports/FileLoaderRegistry.cpp | 3 ++- .../mantid/api/src/Exports/IAlgorithm.cpp | 6 +++-- .../mantid/api/src/Exports/IFunction.cpp | 8 ++++-- .../mantid/api/src/Exports/IFunction1D.cpp | 1 + .../api/src/Exports/IMDHistoWorkspace.cpp | 3 ++- .../mantid/api/src/Exports/IMaskWorkspace.cpp | 3 +++ .../mantid/api/src/Exports/IPeak.cpp | 4 ++- .../api/src/Exports/ISplittersWorkspace.cpp | 1 + .../mantid/api/src/Exports/Jacobian.cpp | 4 +-- .../api/src/Exports/MatrixWorkspace.cpp | 3 ++- .../src/Exports/MultipleExperimentInfos.cpp | 2 ++ .../mantid/api/src/Exports/Run.cpp | 7 +++-- .../src/Exports/ScriptRepositoryFactory.cpp | 1 + .../mantid/api/src/Exports/Workspace.cpp | 8 +++--- .../api/src/Exports/WorkspaceFactory.cpp | 8 +++--- 22 files changed, 82 insertions(+), 35 deletions(-) diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h b/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h index f28cb821523..dc429e1a15f 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/api/WorkspacePropertyExporter.h @@ -137,7 +137,7 @@ template <typename WorkspaceType> struct WorkspacePropertyExporter { .def("__init__", make_constructor( &createPropertyWithValidator, default_call_policies(), - args("name", "defaultValue", "direction", "validator"))) + (arg("name"), arg("defaultValue"), arg("direction"), arg("validator")))) .def("__init__", make_constructor(&createPropertyWithOptionalFlag, default_call_policies(), @@ -149,6 +149,7 @@ template <typename WorkspaceType> struct WorkspacePropertyExporter { args("name", "defaultValue", "direction", "optional", "locking", "validator"))) .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 5de200f7777..83663e18f0c 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/DataServiceExporter.h @@ -66,30 +66,44 @@ 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, + (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("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, + 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 e876486b65c..95e603d5319 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/kernel/TypedValidatorExporter.h @@ -40,6 +40,7 @@ template <typename Type> struct TypedValidatorExporter { class_<TypedValidator<Type>, bases<IValidator>, boost::noncopyable>( pythonClassName, no_init) .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 2ebe6a155f3..1c0e9db570d 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp @@ -78,8 +78,8 @@ void export_leaf_classes() { "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"), arg("endProgress"), + arg("enableLogging"), arg("version")), "Creates and intializes a named child algorithm. Output workspaces " "are given a dummy name.") .def("declareProperty", @@ -87,7 +87,7 @@ void export_leaf_classes() { 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, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp index 2c1705e25f1..a185fc4b017 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp @@ -90,9 +90,10 @@ void export_Axis() { 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"), - "Returns the value at the given point on the Axis. " - "The vertical axis index [default=0]")) + 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, arg("self"), "Return a numpy array of the axis values") .def("setUnit", &Axis::setUnit, (arg("self"), arg("unit_name")), @@ -126,7 +127,9 @@ 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"); } @@ -149,7 +152,9 @@ 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"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp index 2f9350e4ae7..782feec2f82 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/DataProcessorAlgorithm.cpp @@ -70,6 +70,7 @@ void export_DataProcessorAlgorithm() { .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") diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp index f762919cdf1..c80cd1af888 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp @@ -15,11 +15,12 @@ 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, + (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 5935cb7aae9..baa9c3e8a18 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/IAlgorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp index 2bf8059cae0..2c775d7d4b1 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp @@ -400,10 +400,12 @@ void export_ialgorithm() { 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, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp index f755085d7fe..9c7f5b920b4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp @@ -93,10 +93,14 @@ void export_IFunction() { (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")), diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IFunction1D.cpp index b610b945ffb..a435fc7b192 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/IMDHistoWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp index 5ed3e256452..f64840efaf7 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp @@ -197,7 +197,8 @@ void export_IMDHistoWorkspace() { (arg("self"), arg("index"), arg("value")), "Sets the squared-error at the specified index.") - .def("setSignalArray", &setSignalArray, arg("self"), + .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") diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp index 66affb607c0..cacc585f954 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMaskWorkspace.cpp @@ -29,11 +29,14 @@ bool isMaskedFromList(const IMaskWorkspace &self, void export_IMaskWorkspace() { class_<IMaskWorkspace, boost::noncopyable>("IMaskWorkspace", no_init) .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, + (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 3dcc380b56d..6f2d447f7e6 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp @@ -125,8 +125,10 @@ void export_IPeak() { (arg("self"), arg("sigma_intensity")), "Set the error on the integrated peak intensity") .def("getBinCount", &IPeak::getBinCount, + arg("self"), "Return the # of counts in the bin at its peak") - .def("setBinCount", &IPeak::setBinCount, (arg("self"), arg("bin_count")), + .def("setBinCount", &IPeak::setBinCount, + (arg("self"), arg("bin_count")), "Set the # of counts in the bin at its peak") .def("getRow", &IPeak::getRow, arg("self"), "For RectangularDetectors only, returns " diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp index 55585283456..7471b0b121b 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ISplittersWorkspace.cpp @@ -11,6 +11,7 @@ void export_ISplittersWorkspace() { class_<ISplittersWorkspace, boost::noncopyable>("ISplittersWorkspace", no_init) .def("getNumberSplitters", &ISplittersWorkspace::getNumberSplitters, + arg("self"), "Returns the number of splitters within the workspace"); // register pointers diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp index 732cae6fca5..31bb8859817 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Jacobian.cpp @@ -9,11 +9,11 @@ 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/MatrixWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp index fe588b2413c..b695c41e3e4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp @@ -172,7 +172,8 @@ void export_MatrixWorkspace() { (arg("self"), arg("workspaceIndex")), return_internal_reference<>(), "Return the spectra at the given workspace index.") .def("getIndexFromSpectrumNumber", - &MatrixWorkspace::getIndexFromSpectrumNumber, arg("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, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp index e1ee9336718..5ebb9d41783 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MultipleExperimentInfos.cpp @@ -12,8 +12,10 @@ 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, + arg("self"), "Return the number of experiment info objects,"); } diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp index e99ea1c92c6..6f57b9aab6b 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp @@ -182,10 +182,13 @@ void export_Run() { "Returns the value pointed to by the key or the default value given") .def("keys", &keys, arg("self"), "Returns the names of the properties as list") - .def("__contains__", &Run::hasProperty) + .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/ScriptRepositoryFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ScriptRepositoryFactory.cpp index 0f572e8bf63..91eef3e8041 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 79ad1d6ba6c..a926f6057b5 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp @@ -34,9 +34,11 @@ void export_Workspace() { .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)")) + 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) & diff --git a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp index b77d3cc8a15..ad9a9207e81 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp @@ -63,21 +63,21 @@ void export_WorkspaceFactory() { no_init) .def("create", &createFromParentPtr, createFromParent_Overload( - createFromParentDoc, (arg("parent"), arg("NVectors") = -1, + 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")) + (arg("self"), arg("className") = "TableWorkspace")) [return_value_policy<AsType<Workspace_sptr>>()]) .def("createPeaks", &WorkspaceFactoryImpl::createPeaks, createPeaks_Overload("Creates an empty PeaksWorkspace", - (arg("className") = "PeaksWorkspace")) + (arg("self"), arg("className") = "PeaksWorkspace")) [return_value_policy<AsType<Workspace_sptr>>()]) .def("Instance", &WorkspaceFactory::Instance, -- GitLab