diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp index 0df0e6417b49f3a387dacbd0df445430981119e2..4ddd749fd65a76974bb29d85df243d9b78ebb256 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp @@ -73,16 +73,26 @@ 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, + 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, + 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, + arg("self"), return_value_policy<copy_const_reference>(), "Returns the unit object for the axis") .def("getValue", &Axis::getValue, @@ -90,16 +100,26 @@ void export_Axis() { "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")), 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")); } // -------------------------------------------------------------------------------------------- @@ -159,9 +179,15 @@ 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/IAlgorithm.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp index 7028fd156dac835c0496f392c127d663d226145b..be1396fd1ba8d1fcf903ac5cdadb6dd15012d628 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IAlgorithm.cpp @@ -302,41 +302,58 @@ 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("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, + arg("self"), "Request that the algorithm stop running") .def("category", &IAlgorithm::category, + arg("self"), "Returns the category containing the algorithm") .def("categories", &IAlgorithm::categories, + arg("self"), "Returns the list of categories this algorithm belongs to") .def("summary", &IAlgorithm::summary, + arg("self"), "Returns a summary message describing the algorithm") .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, + 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, + arg("self"), "Returns the name of the input workspace property used by the " "calling object") .def("getAlgorithmID", &getAlgorithmID, + arg("self"), "Returns a unique identifier for this algorithm object") .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, + 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, "Returns a list of the output properties on the algorithm") .def("isInitialized", &IAlgorithm::isInitialized, diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp index 77761eb93936d24f8948d8cb9c6fdd1604d6f813..020b9cf7aad6844917c0f9a77fdb7827d30305ab 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp @@ -51,42 +51,56 @@ 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, + 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, + arg("self"), "Declares any parameters and attributes on the function") .def("getCategories", &getCategories, + arg("self"), "Returns a list of the categories for an algorithm") .def("nAttributes", &IFunction::nAttributes, + arg("self"), "Return the number of attributes (non-fitting arguments)") .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, + (arg("self"), arg("i")), "Return the name of the ith parameter") .def("paramDescription", &IFunction::parameterDescription, + (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, + (arg("self"), arg("i")), "Get the value of the ith parameter") .def("getParameterValue", (double (IFunction::*)(const std::string &) const) & IFunction::getParameter, + (arg("self"), arg("name")), "Get the value of the named parameter") .def("setParameter", (setParameterType1)&IFunction::setParameter, @@ -96,21 +110,26 @@ void export_IFunction() { setParameterType2_Overloads("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 -- diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp index bd69cd0dab31b54c2ede7e5b609a0471b05bdde8..a9f042ec247b7848e51f67b98d60b9d0705c57c6 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp @@ -13,13 +13,16 @@ void export_IMDEventWorkspace() { class_<IMDEventWorkspace, bases<IMDWorkspace, MultipleExperimentInfos>, boost::noncopyable>("IMDEventWorkspace", no_init) .def("getNPoints", &IMDEventWorkspace::getNPoints, + arg("self"), "Returns the total number of points (events) in this workspace") .def("getNumDims", &IMDEventWorkspace::getNumDims, + arg("self"), "Returns the number of dimensions in this workspace") .def("getBoxController", (BoxController_sptr (IMDEventWorkspace::*)()) & IMDEventWorkspace::getBoxController, + 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..3ae6965e77ef8dc2b8e74d57e4d502b217ecc496 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp @@ -168,54 +168,67 @@ void export_IMDHistoWorkspace() { class_<IMDHistoWorkspace, bases<IMDWorkspace, MultipleExperimentInfos>, boost::noncopyable>("IMDHistoWorkspace", no_init) .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, + 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"), "Sets the signal from a numpy array. The sizes must match the " "current workspace sizes. A ValueError is thrown if not") .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, + 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 +236,12 @@ 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/IPeak.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp index 13ace3dced290717e05e3ff3888be2e1c5603115..41bd81c045379c771be0f06261d4d746a7b7d1ce 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp @@ -37,94 +37,148 @@ void export_IPeak() { class_<IPeak, boost::noncopyable>("IPeak", no_init) .def("getDetectorID", &IPeak::getDetectorID, + arg("self"), "Get the ID of the detector at the center of the peak") .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, + 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, + 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("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, + arg("self"), "Using the instrument set in the peak, perform ray tracing to find " "the exact detector.") .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 " + .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 " - "position in reciprocal space, " - "in the sample frame.") + .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, + arg("self"), "Return the incident wavelength") .def("getScattering", &IPeak::getScattering, + arg("self"), "Calculate the scattering angle of the peak") .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("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, + 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, + (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, + arg("self"), "Return the error on the integrated peak intensity") .def("setIntensity", &IPeak::setIntensity, + (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, "Return the # of counts in the bin at its peak") .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("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, + arg("self"), "Return the L1 flight path length (source to sample), in meters. ") .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..0c0c19486ea22b10b222ed4224f5c1ad5669221a 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeakFunction.cpp @@ -14,11 +14,14 @@ 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, + 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..2ccf1151a06b14a731fb72fcdd91ad26ed97e496 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp @@ -41,28 +41,39 @@ void export_IPeaksWorkspace() { class_<IPeaksWorkspace, bases<ITableWorkspace, ExperimentInfo>, boost::noncopyable>("IPeaksWorkspace", no_init) .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, + (arg("self"), arg("peak_num")), "Remove a peak from the workspace") .def("getPeak", &IPeaksWorkspace::getPeakPtr, + (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, + (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, + 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..ea0cbceda97aed3cf65837e0aa5b563cfd3461b1 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp @@ -12,21 +12,30 @@ 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, + arg("self"), "Returns the spectrum number of this spectrum") .def("getDetectorIDs", (const std::set<detid_t> &(ISpectrum::*)() const) & ISpectrum::getDetectorIDs, + arg("self"), return_value_policy<copy_const_reference>(), "Returns a list of detector IDs for this spectrum") .def("addDetectorID", &ISpectrum::addDetectorID, + (arg("self"), arg("det_id")), "Add a detector ID to this spectrum") .def("setDetectorID", &ISpectrum::setDetectorID, + (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/ITableWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp index 8280d0fb2512acd690f46edcfa72fcfb2ede005a..4c3a6c8c43db11986c2483f550c2a65bd64ef589 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp @@ -338,51 +338,67 @@ 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")), + .def("removeColumn", &ITableWorkspace::removeColumn, + (arg("self"), arg("name")), "Remove the named column") .def("columnCount", &ITableWorkspace::columnCount, + arg("self"), "Returns the number of columns in the workspace") .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, + arg("self"), "Returns the number of rows within the workspace") .def("getColumnNames", &ITableWorkspace::getColumnNames, + arg("self"), boost::python::return_value_policy<VectorToNumpy>(), "Return a list of the column names") .def("keys", &ITableWorkspace::getColumnNames, + arg("self"), boost::python::return_value_policy<VectorToNumpy>(), "Return a list of the column names") .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, + (arg("self"), arg("row_items_dict")), "Appends a row with the values from the dictionary") .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, + (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/MDGeometry.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp index 2c62473353409541efc3e8d1a815ac758c4ad425..8101365252b35e98fb841065ccd0648c237728f4 100644 --- a/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp +++ b/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp @@ -36,87 +36,102 @@ boost::python::list getNonIntegratedDimensionsAsPyList(const MDGeometry &self) { void export_MDGeometry() { class_<MDGeometry, boost::noncopyable>("MDGeometry", no_init) .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 " + (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 " + (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, + arg("self"), return_value_policy<VectorToNumpy>(), "Returns a numpy array containing the width of the smallest bin in " "each dimension") .def("getXDimension", &MDGeometry::getXDimension, + arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to X") .def("getYDimension", &MDGeometry::getYDimension, + arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to Y") .def("getZDimension", &MDGeometry::getZDimension, + arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to Z") .def("getTDimension", &MDGeometry::getTDimension, + arg("self"), return_value_policy<RemoveConstSharedPtr>(), "Returns the dimension description mapped to time") .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, + 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, + 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, + arg("self"), "Returns the number of transformations from original workspace " "coordinate systems") .def("getNumberTransformsToOriginal", &MDGeometry::getNumberTransformsToOriginal, + arg("self"), "Returns the number of transformations to original workspace " "coordinate systems")