Skip to content

Commit

Permalink
Re #10545. Removed IncreasingDataValidator.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Nov 19, 2014
1 parent 8f38811 commit edd88dc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 47 deletions.
38 changes: 0 additions & 38 deletions Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceValidators.h
Expand Up @@ -369,44 +369,6 @@ class DLLExport IncreasingAxisValidator : public MatrixWorkspaceValidator
}
};

//===============================================================================================
/**
* A validator which checks whether data in each spectrum of the input workspace are monotonically increasing.
*/
class DLLExport IncreasingDataValidator : public MatrixWorkspaceValidator
{
public:
///Gets the type of the validator
std::string getType() const { return "increasingdata"; }
/// Clone the current state
Kernel::IValidator_sptr clone() const { return boost::make_shared<IncreasingDataValidator>(*this); }

private:
/** Validate a workspace.
* @param value :: The workspace to test
* @return A message for users with negative results, otherwise ""
*/
std::string checkValidity( const MatrixWorkspace_sptr& value ) const
{
if ( value->blocksize() < 2 )
{
return "Spectra must have two or more data points (bins).";
}
for(size_t spec = 0; spec < value->getNumberHistograms(); ++spec)
{
auto &Y = value->readY( spec );
double y = Y.front();
for(auto it = Y.begin() + 1; it != Y.end(); ++it)
{
if ( y > *it ) return "Data in the workspace must monotonically increase.";
y = *it;
}
}
return "";
}

};

} // namespace API
} // namespace Mantid

Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp
Expand Up @@ -158,7 +158,7 @@ class NoEventWorkspaceDeleting
}

/**
* Integrate spectra in eventWS at x-values in integrWS and save the results in y-vectors of integrWS.
* Integrate spectra in inputWS at x-values in integrWS and save the results in y-vectors of integrWS.
* @param inputWS :: An event workspace to integrate.
* @param integrWS :: A workspace to store the results.
*/
Expand Down Expand Up @@ -195,7 +195,7 @@ class NoEventWorkspaceDeleting
}

/**
* Integrate spectra in eventWS at x-values in integrWS and save the results in y-vectors of integrWS.
* Integrate spectra in inputWS at x-values in integrWS and save the results in y-vectors of integrWS.
* @param inputWS :: A 2d workspace to integrate.
* @param integrWS :: A workspace to store the results.
*/
Expand All @@ -214,7 +214,7 @@ class NoEventWorkspaceDeleting
}

/**
* Integrate spectra in eventWS at x-values in integrWS and save the results in y-vectors of integrWS.
* Integrate spectra in inputWS at x-values in integrWS and save the results in y-vectors of integrWS.
* @param inputWS :: A 2d workspace to integrate.
* @param integrWS :: A workspace to store the results.
*/
Expand Down Expand Up @@ -346,7 +346,7 @@ class NoEventWorkspaceDeleting
}

/**
* Integrate spectra in eventWS at x-values in integrWS and save the results in y-vectors of integrWS.
* Integrate spectra in inputWS at x-values in integrWS and save the results in y-vectors of integrWS.
* @param inputWS :: A 2d workspace to integrate.
* @param integrWS :: A workspace to store the results.
*/
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/MDAlgorithms/src/MDNormSXD.cpp
Expand Up @@ -97,7 +97,6 @@ namespace MDAlgorithms
fluxValidator->add<InstrumentValidator>();
fluxValidator->add<CommonBinsValidator>();
auto solidAngleValidator = fluxValidator->clone();
fluxValidator->add<IncreasingDataValidator>();

declareProperty(new WorkspaceProperty<>("FluxWorkspace","",Direction::Input,fluxValidator), "An input workspace containing integrated momentum dependent flux.");
declareProperty(new WorkspaceProperty<>("SolidAngleWorkspace","",Direction::Input,solidAngleValidator), "An input workspace containing momentum integrated vanadium (a measure of the solid angle).");
Expand Down
4 changes: 0 additions & 4 deletions Code/Mantid/docs/source/algorithms/IntegrateFlux-v1.rst
Expand Up @@ -15,8 +15,6 @@ the output workspace has its indefinite integral:

:math:`\int_{x_0}^x f(\xi)d\xi`.

The input workspace is expected to be an event workspace with weighted-no-time events.


Usage
-----
Expand All @@ -27,8 +25,6 @@ Usage

# Create an event workspace
ws = CreateSampleWorkspace("Event")
# Make evet type weighted-no-time.
ws = CompressEvents( ws )
# Integrate all spectra.
wsOut = IntegrateFlux( ws )

Expand Down

0 comments on commit edd88dc

Please sign in to comment.