17 const std::unordered_set<int> &allowedNumberOfPeriods)
18 : m_expectHistogramData(expectHistogramData), m_allowMultiPeriodData(allowMultiPeriodData),
19 m_allowedNumberOfPeriods(allowedNumberOfPeriods) {};
22 return std::make_shared<PolSANSWorkspaceValidator>(*
this);
26 std::vector<std::string> workspaceIssues;
28 return "All workspaces must be of type MatrixWorkspace.";
32 if (unit->unitID() !=
"Wavelength") {
33 workspaceIssues.push_back(
"All workspaces must be in units of Wavelength.");
37 workspaceIssues.push_back(
"All workspaces must contain a single histogram.");
42 workspaceIssues.push_back(
"All workspaces must be histogram data.");
44 workspaceIssues.push_back(
"All workspaces must not be histogram data.");
48 if (!workspaceIssues.empty()) {
57 const int numberOfEntries =
workspace->getNumberOfEntries();
59 return "The number of periods within the input workspace is not an allowed value.";
63 const auto groupItem = std::dynamic_pointer_cast<API::MatrixWorkspace>(ws);
IPeaksWorkspace_sptr workspace
Kernel::IValidator_sptr clone() const override
Clone the current state.
PolSANSWorkspaceValidator(bool expectHistogramData=true, bool allowMultiPeriodData=false, const std::unordered_set< int > &allowedNumberOfPeriods={4})
const std::unordered_set< int > m_allowedNumberOfPeriods
const bool m_allowMultiPeriodData
std::string checkValidity(const WorkspaceGroup_sptr &workspace) const override
Check for validity.
std::string validateGroupItem(API::MatrixWorkspace_sptr const &workspace) const
const bool m_expectHistogramData
std::shared_ptr< WorkspaceGroup > WorkspaceGroup_sptr
shared pointer to Mantid::API::WorkspaceGroup
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
DLLExport std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if<!(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type *=nullptr)
Join a set or vector of (something that turns into a string) together into one string,...
std::shared_ptr< const Unit > Unit_const_sptr
Shared pointer to the Unit base class (const version)
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Helper class which provides the Collimation Length for SANS instruments.