Skip to content

Commit

Permalink
Restoring a good commit. Re #6485.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Mar 1, 2013
1 parent 1da9d42 commit 77cfae9
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 39 deletions.
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
}

//---------------------------------------------------------------------------------------------
Expand Down
17 changes: 11 additions & 6 deletions Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp
Expand Up @@ -46,16 +46,21 @@ namespace Mantid
declareProperty(new WorkspaceProperty<MatrixWorkspace>(inputPropName2(),"",Direction::Input));
declareProperty(new WorkspaceProperty<MatrixWorkspace>(outputPropName(),"",Direction::Output));
declareProperty(new PropertyWithValue<bool>("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<bool>("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.
*
Expand Down
Expand Up @@ -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<BoundedValidator<double> >();
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
Expand Down
Expand Up @@ -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.
Expand Down Expand Up @@ -65,35 +65,31 @@ namespace Mantid
declareProperty(
new WorkspaceProperty<MatrixWorkspace>("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<MatrixWorkspace>("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<BoundedValidator<double> >();
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<BoundedValidator<int> >();
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);
}
Expand Down
Expand Up @@ -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<BoundedValidator<int> >();
Expand Down
23 changes: 21 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/Divide.cpp
@@ -1,6 +1,22 @@
/*WIKI*
{{BinaryOperation|verb=divided|prep=by|symbol=<math>\div</math>}}
{{BinaryOperationFooterMultiply|verb=divided|prep=by|symbol=<math>\div</math>}}
== 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''' <br/>
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
Expand All @@ -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=<math>\\div</math>}} ");
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.");
}


Expand Down
Expand Up @@ -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.");
}

Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp
Expand Up @@ -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.");
}


Expand All @@ -39,7 +39,7 @@ namespace Mantid
{
declareProperty(new WorkspaceProperty<API::ITableWorkspace>("TableWorkspace", "",Direction::InOut),
"The name of the workspace that will be modified.");
declareProperty(new ArrayProperty<size_t> ("Rows"),"The rows to delete. Numbering starts with 0.");
declareProperty(new ArrayProperty<size_t> ("Rows"),"A comma-separated list of row numbers. Row numbering starts with 0.");
}

/**
Expand Down
8 changes: 3 additions & 5 deletions Code/Mantid/Framework/DataHandling/src/DetermineChunking.cpp
Expand Up @@ -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.");
}


Expand All @@ -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<BoundedValidator<double> >();
mustBePositive->setLower(0.0);
Expand Down

0 comments on commit 77cfae9

Please sign in to comment.