diff --git a/Code/Mantid/Framework/API/src/Algorithm.cpp b/Code/Mantid/Framework/API/src/Algorithm.cpp index ebd789753ac0..a77f2b4fa821 100644 --- a/Code/Mantid/Framework/API/src/Algorithm.cpp +++ b/Code/Mantid/Framework/API/src/Algorithm.cpp @@ -239,9 +239,6 @@ namespace Mantid // Bypass the initialization if the algorithm has already been initialized. if (m_isInitialized) return; - // Set the documentation. This virtual method is overridden by (nearly) all algorithms and gives documentation summary. - initDocs(); - g_log.setName(this->name()); try { @@ -271,6 +268,9 @@ namespace Mantid g_log.fatal("UNKNOWN Exception is caught in initialize()"); throw; } + + // Set the documentation. This virtual method is overridden by (nearly) all algorithms and gives documentation summary. + initDocs(); } //--------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp b/Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp index b6b3718b2f99..edc03183f5c7 100644 --- a/Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp +++ b/Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp @@ -46,16 +46,21 @@ namespace Mantid declareProperty(new WorkspaceProperty(inputPropName2(),"",Direction::Input)); declareProperty(new WorkspaceProperty(outputPropName(),"",Direction::Output)); declareProperty(new PropertyWithValue("AllowDifferentNumberSpectra", false, Direction::Input), - "Allow workspaces to have different number of spectra and perform\n" - "operation on LHS spectra using matching detector IDs in RHS.\n"); + "Are workspaces with different number of spectra allowed? " + "For example, the LHSWorkspace might have one spectrum per detector, " + "but the RHSWorkspace could have its spectra averaged per bank. If true, " + "then matching between the LHS and RHS spectra is performed (all detectors " + "in a LHS spectrum have to be in the corresponding RHS) in order to apply the RHS spectrum to the LHS."); declareProperty(new PropertyWithValue("ClearRHSWorkspace", false, Direction::Input), - "Clear the RHS workspace as the operation is performed.\n" - "This can help prevent maxing out available memory for large workspaces.\n" - "This is ignored unless the RHS workspace is an EventWorkpsace.\n"); + "For EventWorkspaces only. This will clear out event lists " + "from the RHS workspace as the binary operation is applied. " + "This can prevent excessive memory use, e.g. when subtracting " + "an EventWorkspace from another: memory use will be approximately " + "constant instead of increasing by 50%. At completion, the RHS workspace will be empty."); } - + //-------------------------------------------------------------------------------------------- /** Special handling for 1-WS and 1/WS. * diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp index 6250352777ed..06633ceae492 100644 --- a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCor.cpp @@ -107,11 +107,11 @@ void DetectorEfficiencyCor::init() "The workspace to correct for detector efficiency"); declareProperty( new WorkspaceProperty<>("OutputWorkspace", "", Direction::Output), - "The name of the workspace in which to store the result" ); + "The name of the workspace in which to store the result. Each histogram from the input workspace maps to a histogram in this workspace that has just one value which indicates if there was a bad detector." ); auto checkEi = boost::make_shared >(); checkEi->setLower(0.0); declareProperty("IncidentEnergy", EMPTY_DBL(), checkEi, - "The energy kinetic the neutrons have before they hit the sample (meV)" ); + "The energy of neutrons leaving the source. This algorithm assumes that this number is accurate and does not correct it using the output from [[GetEi]]." ); } /** Executes the algorithm diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp index 237d72196068..aafd9536c8f6 100644 --- a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp @@ -10,7 +10,7 @@ where sum1 is the sum of the counts in a histogram in the workspace WhiteBeamBas The output workspace contains a MaskWorkspace where those spectra that fail the tests are masked and those that pass them are assigned a single positive value. -====ChildAlgorithms used==== +====Child algorithms used==== Uses the [[Integration]] algorithm to sum the spectra. @@ -65,35 +65,31 @@ namespace Mantid declareProperty( new WorkspaceProperty("WhiteBeamCompare","",Direction::Input, val), - "Name of a matching second white beam vanadium run from the same\n" + "Name of a matching second white beam vanadium run from the same " "instrument" ); declareProperty( new WorkspaceProperty("OutputWorkspace","",Direction::Output), - "A MaskWorkpace where each spectra that failed the test is masked" ); - + "A MaskWorkpace where each spectra that failed the test is masked. Each histogram from the input workspace maps to a histogram in this workspace with one value that indicates if there was a dead detector." ); auto moreThanZero = boost::make_shared >(); moreThanZero->setLower(0.0); declareProperty("Variation", 1.1, moreThanZero, - "Identify spectra whose total number of counts has changed by more\n" - "than this factor of the median change between the two input workspaces" ); + "Identify histograms whose total number of counts has changed by more than this factor of the median change between the two input workspaces." ); auto mustBePosInt = boost::make_shared >(); mustBePosInt->setLower(0); declareProperty("StartWorkspaceIndex", 0, mustBePosInt, - "The index number of the first entry in the Workspace to include in\n" - "the calculation (default: 0)" ); + "The index number of the first spectrum to include in the calculation (default: 0)" ); //Mantid::EMPTY_INT() and EMPTY_DBL() are tags that indicate that no // value has been set and we want to use the default declareProperty("EndWorkspaceIndex", Mantid::EMPTY_INT(), mustBePosInt, - "The index number of the last entry in the Workspace to include in\n" - "the calculation (default: the last spectrum in the workspace)" ); + "The index number of the last spectrum to include in the calculation (default: the last spectrum in the workspace)" ); declareProperty("RangeLower", Mantid::EMPTY_DBL(), - "No bin with a boundary at an x value less than this will be included\n" - "in the summation used to decide if a detector is 'bad' (default: the\n" + "No bin with a boundary at an x value less than this will be included " + "in the summation used to decide if a detector is 'bad' (default: the " "start of each histogram)" ); declareProperty("RangeUpper", Mantid::EMPTY_DBL(), - "No bin with a boundary at an x value higher than this value will\n" - "be included in the summation used to decide if a detector is 'bad'\n" + "No bin with a boundary at an x value higher than this value will " + "be included in the summation used to decide if a detector is 'bad' " "(default: the end of each histogram)" ); declareProperty("NumberOfFailures", 0, Direction::Output); } diff --git a/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp index 93f580540931..31715bc89639 100644 --- a/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp @@ -280,9 +280,9 @@ namespace Algorithms "The workspace containing the geometry to be calibrated." ); declareProperty("Params", "", - "A comma separated list of first bin boundary, width, last bin boundary. Optionally\n" - "this can be followed by a comma and more widths and last boundary pairs.\n" - "Use bin boundaries close to peak you wish to maximize.\n" + "A comma separated list of first bin boundary, width, last bin boundary. Optionally " + "this can be followed by a comma and more widths and last boundary pairs. " + "Use bin boundaries close to peak you wish to maximize. " "Negative width values indicate logarithmic binning."); auto mustBePositive = boost::make_shared >(); diff --git a/Code/Mantid/Framework/Algorithms/src/Divide.cpp b/Code/Mantid/Framework/Algorithms/src/Divide.cpp index 74d03f862fa5..9e6dcb90800f 100644 --- a/Code/Mantid/Framework/Algorithms/src/Divide.cpp +++ b/Code/Mantid/Framework/Algorithms/src/Divide.cpp @@ -1,6 +1,22 @@ /*WIKI* - +{{BinaryOperation|verb=divided|prep=by|symbol=\div}} +{{BinaryOperationFooterMultiply|verb=divided|prep=by|symbol=\div}} + +== Usage == +'''Python''' + Divide("w1","w2","output") + w3 = w1 / w2 + w1 /= w2 # Perform "in-place" + # Using a scalar + w3 = w1 / 2.5 + w1 /= 2.5 # Perform "in-place" + +'''C++ Within an Algorithm'''
+The usage of basic workspace mathematical operations has been specially simplified for use within algorithms + + //w1 and w2 are workspaces + workspace_sptr output = w1 / w2; *WIKI*/ //---------------------------------------------------------------------- // Includes @@ -22,8 +38,11 @@ namespace Mantid /// Sets documentation strings for this algorithm void Divide::initDocs() { - this->setWikiSummary("The Divide algorithm will divide the data values and calculate the corresponding [[Error Values|error values]] of two compatible workspaces. {{BinaryOperation|verb=divided|prep=by|symbol=\\div}} "); + this->setWikiSummary("The Divide algorithm will divide the data values and calculate the corresponding [[Error Values|error values]] of two compatible workspaces. "); this->setOptionalMessage("The Divide algorithm will divide the data values and calculate the corresponding error values of two compatible workspaces."); + this->getPointerToProperty("LHSWorkspace")->setDocumentation("The workspace to be divided by, this can be considered to be the workspace on the left hand side of the division symbol."); + this->getPointerToProperty("RHSWorkspace")->setDocumentation("The workspace to be divided, this can be considered to be the workspace on the right hand side of the division symbol."); + this->getPointerToProperty("OutputWorkspace")->setDocumentation("The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service."); } diff --git a/Code/Mantid/Framework/DataHandling/src/DefineGaugeVolume.cpp b/Code/Mantid/Framework/DataHandling/src/DefineGaugeVolume.cpp index 6fcfc9a0daf5..a81bf58f7ff2 100644 --- a/Code/Mantid/Framework/DataHandling/src/DefineGaugeVolume.cpp +++ b/Code/Mantid/Framework/DataHandling/src/DefineGaugeVolume.cpp @@ -30,7 +30,7 @@ DECLARE_ALGORITHM(DefineGaugeVolume) /// Sets documentation strings for this algorithm void DefineGaugeVolume::initDocs() { - this->setWikiSummary(" Defines a geometrical shape object to be used as the gauge volume in the [[AbsorptionCorrection]] algorithm. "); + this->setWikiSummary("Defines a geometrical shape object to be used as the gauge volume in the [[AbsorptionCorrection]] algorithm. "); this->setOptionalMessage("Defines a geometrical shape object to be used as the gauge volume in the AbsorptionCorrection algorithm."); } diff --git a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp index d26a811dd753..c7993c9b9d4e 100644 --- a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp +++ b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp @@ -26,8 +26,8 @@ namespace Mantid /// Sets documentation strings for this algorithm void DeleteTableRows::initDocs() { - this->setWikiSummary("Deletes a row from a TableWorkspace."); - this->setOptionalMessage("Deletes a row from a TableWorkspace."); + this->setWikiSummary("Deletes rows from a TableWorkspace."); + this->setOptionalMessage("Deletes rows from a TableWorkspace."); } @@ -39,7 +39,7 @@ namespace Mantid { declareProperty(new WorkspaceProperty("TableWorkspace", "",Direction::InOut), "The name of the workspace that will be modified."); - declareProperty(new ArrayProperty ("Rows"),"The rows to delete. Numbering starts with 0."); + declareProperty(new ArrayProperty ("Rows"),"A comma-separated list of row numbers. Row numbering starts with 0."); } /** diff --git a/Code/Mantid/Framework/DataHandling/src/DetermineChunking.cpp b/Code/Mantid/Framework/DataHandling/src/DetermineChunking.cpp index 6af89655fa36..c6276cb47c40 100644 --- a/Code/Mantid/Framework/DataHandling/src/DetermineChunking.cpp +++ b/Code/Mantid/Framework/DataHandling/src/DetermineChunking.cpp @@ -88,8 +88,8 @@ namespace DataHandling /// @copydoc Mantid::API::Algorithm::initDocs() void DetermineChunking::initDocs() { - this->setWikiSummary("Determine chunking strategy for event nexus, runinfo.xml, raw, or histo nexus files."); - this->setOptionalMessage("Determine chunking strategy for event nexus, runinfo.xml, raw, or histo nexus files."); + this->setWikiSummary("Workflow algorithm to determine chunking strategy for event nexus, runinfo.xml, raw, or histo nexus files."); + this->setOptionalMessage("Workflow algorithm to determine chunking strategy for event nexus, runinfo.xml, raw, or histo nexus files."); } @@ -105,9 +105,7 @@ namespace DataHandling exts.push_back(".nxs"); exts.push_back(".raw"); this->declareProperty(new FileProperty("Filename", "", FileProperty::Load, exts), - "The name of the runinfo file to read, including its full or relative path. \n" - "Or the name of the Event NeXus file to read, including its full or relative path. \n" - "The Event NeXus file name is typically of the form INST_####_event.nxs (N.B. case sensitive if running on Linux)." ); + "The name of the event nexus, runinfo.xml, raw, or histo nexus file to read, including its full or relative path. The Event NeXus file name is typically of the form INST_####_event.nxs (N.B. case sensitive if running on Linux)." ); auto mustBePositive = boost::make_shared >(); mustBePositive->setLower(0.0);