Mantid
Loading...
Searching...
No Matches
SampleLogsBehaviour.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#include <utility>
8
10#include "MantidAPI/Run.h"
18
19namespace Mantid::Algorithms {
20
21using namespace Kernel;
22using namespace API;
23
24namespace {
25std::string generateDifferenceMessage(const std::string &item, const std::string &wsName, const std::string &wsValue,
26 const std::string &firstValue) {
27 std::stringstream stringstream;
28 stringstream << "Item \"" << item << "\" has different values in workspaces! Found: " << wsValue << " in workspace "
29 << wsName << " but the value in the first workspace was: " << firstValue << "." << std::endl;
30 return stringstream.str();
31}
32} // namespace
33
34// Names and docs from the properties allowing to override the default (IPF
35// controlled) merging behaviour.
36// These are common between e.g. MergeRuns and ConjoinXRuns.
37const std::string SampleLogsBehaviour::TIME_SERIES_PROP = "SampleLogsTimeSeries";
38const std::string SampleLogsBehaviour::TIME_SERIES_DOC = "A comma separated list of the sample logs to merge into a "
39 "time series. The initial times are taken as the start times "
40 "for the run. Sample logs must be numeric.";
41const std::string SampleLogsBehaviour::LIST_PROP = "SampleLogsList";
42const std::string SampleLogsBehaviour::LIST_DOC = "A comma separated list of the sample logs to merge into a "
43 "list.";
44const std::string SampleLogsBehaviour::WARN_PROP = "SampleLogsWarn";
45const std::string SampleLogsBehaviour::WARN_DOC = "A comma separated list of the sample "
46 "logs to generate a warning if "
47 "different when merging.";
48const std::string SampleLogsBehaviour::WARN_TOL_PROP = "SampleLogsWarnTolerances";
49const std::string SampleLogsBehaviour::WARN_TOL_DOC = "The tolerances for warning if sample logs are different. "
50 "Can either be empty for a comparison of the strings, a "
51 "single value for all warn sample logs, or a comma "
52 "separated list of values (must be the same length as "
53 "SampleLogsWarn).";
54const std::string SampleLogsBehaviour::FAIL_PROP = "SampleLogsFail";
55const std::string SampleLogsBehaviour::FAIL_DOC = "The sample logs to fail if different "
56 "when merging. If there is a "
57 "difference the run is skipped.";
58const std::string SampleLogsBehaviour::FAIL_TOL_PROP = "SampleLogsFailTolerances";
59const std::string SampleLogsBehaviour::FAIL_TOL_DOC = "The tolerances for failing if sample logs are different. "
60 "Can either be empty for a comparison of the strings, a "
61 "single value for all fail sample logs, or a comma "
62 "separated list of values (must be the same length as "
63 "SampleLogsFail).";
64const std::string SampleLogsBehaviour::SUM_PROP = "SampleLogsSum";
65const std::string SampleLogsBehaviour::SUM_DOC = "A comma separated list of the sample "
66 "logs to sum into a single entry. "
67 "Sample logs must be numeric.";
68
82 const SampleLogNames &logEntries, ParameterName parName)
83 : parameterNames(std::move(parName)), m_logger(logger) {
89
90 SampleLogsMap instrumentMap;
91 this->createSampleLogsMapsFromInstrumentParams(instrumentMap, *ws);
92
93 // This adds the parameters from the instrument to the main map, with any
94 // duplicates left as the versions in the MergeRuns arguments.
95 m_logMap.insert(instrumentMap.begin(), instrumentMap.end());
96}
97
106 std::string params = ws.getInstrument()->getParameterAsString(parameterNames.SUM_MERGE, false);
107 setSampleMap(map, MergeLogType::Sum, params, ws, "", true);
108
109 params = ws.getInstrument()->getParameterAsString(parameterNames.TIME_SERIES_MERGE, false);
110 setSampleMap(map, MergeLogType::TimeSeries, params, ws, "", true);
111
112 params = ws.getInstrument()->getParameterAsString(parameterNames.LIST_MERGE, false);
113 setSampleMap(map, MergeLogType::List, params, ws, "", true);
114
115 params = ws.getInstrument()->getParameterAsString(parameterNames.WARN_MERGE, false);
116 std::string paramsTolerances;
117 paramsTolerances = ws.getInstrument()->getParameterAsString(parameterNames.WARN_MERGE_TOLERANCES, false);
118 setSampleMap(map, MergeLogType::Warn, params, ws, paramsTolerances, true);
119
120 params = ws.getInstrument()->getParameterAsString(parameterNames.FAIL_MERGE, false);
121 paramsTolerances = ws.getInstrument()->getParameterAsString(parameterNames.FAIL_MERGE_TOLERANCES, false);
122 setSampleMap(map, MergeLogType::Fail, params, ws, paramsTolerances, true);
123}
124
141void SampleLogsBehaviour::setSampleMap(SampleLogsMap &map, const MergeLogType &mergeType, const std::string &params,
142 MatrixWorkspace &ws, const std::string &paramsTolerances,
143 bool skipIfInPrimaryMap) {
144
146 StringTokenizer tokenizerTolerances(paramsTolerances, ",",
148
149 auto tolerancesStringVector = tokenizerTolerances.asVector();
150
151 std::vector<double> tolerancesVector = createTolerancesVector(tokenizer.asVector().size(), tolerancesStringVector);
152
153 auto i = tokenizer.begin();
154 auto j = tolerancesVector.begin();
155
156 for (; i != tokenizer.end() && j != tolerancesVector.end(); ++i, ++j) {
157 auto item = *i;
158 auto tolerance = *j;
159
160 // Check 1: Does the key exist in the primary map? If so ignore it and
161 // continue.
162 if (skipIfInPrimaryMap && (m_logMap.count(SampleLogsKey(item, mergeType)) != 0)) {
163 continue;
164 }
165
166 // Check 2: If the key (sample log name) already exists in this map throw an
167 // error.
168 if (map.count(SampleLogsKey(item, mergeType)) != 0) {
169 throw std::invalid_argument("Error when making list of merge items, sample log \"" + item +
170 "\" defined more than once!");
171 }
172
173 // Check 3: If the sample log is one that should not be combined with
174 // others, check other incompatible sample logs do not exist too.
175 std::set<MergeLogType> uncombinableLogs = {MergeLogType::Sum, MergeLogType::TimeSeries, MergeLogType::List};
176 if (uncombinableLogs.count(mergeType) != 0) {
177 bool skipLog = false;
178
179 uncombinableLogs.erase(mergeType);
180 for (auto &logType : uncombinableLogs) {
181 if (map.count(SampleLogsKey(item, logType)) > 0)
182 throw std::invalid_argument("Error when making list of merge items, sample log " + item +
183 " being used for two incompatible merge types!");
184 if (skipIfInPrimaryMap && m_logMap.count(SampleLogsKey(item, logType)) > 0)
185 skipLog = true;
186 }
187
188 if (skipLog)
189 continue;
190 }
191
192 // Check 4: Does the sample log exist? If not log an error but continue.
193 std::shared_ptr<Property> prop;
194 try {
195 prop = std::shared_ptr<Property>(ws.getLog(item)->clone());
196 } catch (std::invalid_argument &) {
197 m_logger.error() << "Could not merge sample log \"" << item
198 << "\", does not exist in workspace! This sample log will be ignored." << std::endl;
199 continue;
200 }
201
202 // Check 5: Can the property be converted to a double? If not, and sum or
203 // time series case, log an error but continue.
204 bool isNumeric;
205 double value = 0.0;
206 isNumeric = setNumericValue(item, ws, value);
207 if (!isNumeric && (mergeType == MergeLogType::Sum || mergeType == MergeLogType::TimeSeries)) {
208 m_logger.error() << item
209 << " could not be converted to a numeric type. "
210 "This sample log will be ignored.\n"
211 << std::endl;
212 continue;
213 }
214
215 // For a TimeSeries or a List we need to add a new property to the workspace
216 if (mergeType == MergeLogType::TimeSeries) {
217 prop = addPropertyForTimeSeries(item, value, ws);
218 } else if (mergeType == MergeLogType::List) {
219 prop = addPropertyForList(item, prop->value(), ws);
220 }
221
222 // Finally add the key-value pair to the map
223 map[SampleLogsKey(item, mergeType)] = {prop, tolerance, isNumeric};
224 }
225}
226
238std::vector<double> SampleLogsBehaviour::createTolerancesVector(size_t numberNames,
239 const std::vector<std::string> &tolerances) {
240 size_t numberTolerances = tolerances.size();
241
242 std::vector<double> tolerancesVector(numberNames);
243
244 if (numberNames == numberTolerances && numberTolerances > 1) {
245 try {
246 std::transform(tolerances.begin(), tolerances.end(), tolerancesVector.begin(),
247 [](const std::string &val) { return std::stod(val); });
248 } catch (std::invalid_argument &) {
249 throw std::invalid_argument("Error when creating tolerances vector. "
250 "Please ensure each comma separated value is "
251 "numeric.");
252 } catch (std::out_of_range &) {
253 throw std::out_of_range("Error when creating tolerances vector. Please "
254 "ensure each comma separated value is within "
255 "double precision range.");
256 }
257 if (std::any_of(tolerancesVector.cbegin(), tolerancesVector.cend(), [](const auto value) { return value < 0.; })) {
258 throw std::out_of_range("Error when creating tolerances vector. Please "
259 "ensure all tolerance values are positive.");
260 }
261 } else if (tolerances.empty()) {
262 std::fill(tolerancesVector.begin(), tolerancesVector.end(), -1.0);
263 } else if (numberTolerances == 1) {
264 double value;
265 try {
266 value = std::stod(tolerances.front());
267 std::fill(tolerancesVector.begin(), tolerancesVector.end(), value);
268 } catch (std::invalid_argument &) {
269 throw std::invalid_argument("The single tolerance value requested can "
270 "not be converted to a number. Please ensure "
271 "it is a single number, or a comma separated "
272 "list of numbers.");
273 } catch (std::out_of_range &) {
274 throw std::out_of_range("The single tolerance value requested can not be "
275 "converted to a double. Please ensure tolerance "
276 "is within double precision range.");
277 }
278 if (value < 0)
279 throw std::out_of_range("The single tolerance value requested is "
280 "negative. Please ensure it is positive.");
281 } else {
282 throw std::invalid_argument("Invalid length of tolerances, found " + std::to_string(numberTolerances) +
283 " tolerance values but " + std::to_string(numberNames) + " names.");
284 }
285
286 return tolerancesVector;
287}
288
297std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForTimeSeries(const std::string &item, const double value,
298 MatrixWorkspace &ws) {
299 std::shared_ptr<Property> returnProp;
300 const std::string originalUnit = ws.getLog(item)->units();
301 try {
302 // See if property exists as a TimeSeriesLog already - merging an output of
303 // MergeRuns
304 ws.run().getTimeSeriesProperty<double>(item);
305 returnProp.reset(ws.getLog(item)->clone());
306 } catch (std::invalid_argument &) {
307 // Property does not already exist, so add it setting the first entry
308 std::unique_ptr<Kernel::TimeSeriesProperty<double>> timeSeriesProp(new TimeSeriesProperty<double>(item));
309 std::string startTime = ws.run().startTime().toISO8601String();
310
311 timeSeriesProp->addValue(startTime, value);
312 ws.mutableRun().addProperty(std::move(timeSeriesProp), true);
313
314 returnProp.reset(ws.getLog(item)->clone());
315 }
316 ws.getLog(item)->setUnits(originalUnit); // we lost the unit of the workspace
317 return returnProp;
318}
319
328std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForList(const std::string &item, const std::string &value,
329 MatrixWorkspace &ws) {
330 std::shared_ptr<Property> returnProp;
331
332 const std::string originalUnit = ws.getLog(item)->units();
333 // See if property exists already - merging an output of the calling algorithm
334 returnProp.reset(ws.getLog(item)->clone());
335 if (returnProp->type() != "string") {
336 ws.mutableRun().addProperty(item, value, true);
337 returnProp.reset(ws.getLog(item)->clone());
338 }
339 ws.getLog(item)->setUnits(originalUnit); // we lost the unit of the workspace
340 return returnProp;
341}
342
352bool SampleLogsBehaviour::setNumericValue(const std::string &item, const MatrixWorkspace &ws, double &value) {
353 bool isNumeric;
354
355 try {
356 value = ws.getLogAsSingleValue(item);
357 isNumeric = true;
358 } catch (std::invalid_argument &) {
359 isNumeric = false;
360 }
361
362 return isNumeric;
363}
364
372 for (const auto &item : m_logMap) {
373 const std::string &logName = item.first.first;
374
375 const Property *addeeWSProperty = addeeWS->getLog(logName);
376 const std::string originalUnit = addeeWS->getLog(logName)->units();
377
378 double addeeWSNumericValue = 0.;
379 double outWSNumericValue = 0.;
380
381 try {
382 addeeWSNumericValue = addeeWS->getLogAsSingleValue(logName);
383 outWSNumericValue = outWS->getLogAsSingleValue(logName);
384 } catch (std::invalid_argument &) {
385 if (item.second.isNumeric) {
386 throw std::invalid_argument(logName + " could not be converted to a numeric type");
387 }
388 }
389
390 switch (item.first.second) {
391 case MergeLogType::Sum: {
392 this->updateSumProperty(addeeWSNumericValue, outWSNumericValue, *outWS, logName);
393 break;
394 }
396 this->updateTimeSeriesProperty(*addeeWS, *outWS, logName);
397 break;
398 }
399 case MergeLogType::List: {
400 this->updateListProperty(*addeeWS, *outWS, logName);
401 break;
402 }
404 this->checkWarnProperty(*addeeWS, addeeWSProperty, item.second, addeeWSNumericValue, outWSNumericValue, logName);
405 break;
407 this->checkErrorProperty(*addeeWS, addeeWSProperty, item.second, addeeWSNumericValue, outWSNumericValue, logName);
408 break;
409 }
410 outWS->getLog(logName)->setUnits(originalUnit);
411 }
412}
413
424void SampleLogsBehaviour::updateSumProperty(double addeeWSNumericValue, double outWSNumericValue,
425 MatrixWorkspace &outWS, const std::string &name) {
426 outWS.mutableRun().addProperty(name, addeeWSNumericValue + outWSNumericValue, true);
427}
428
438 const std::string &name) {
439 auto timeSeriesProp = outWS.run().getTimeSeriesProperty<double>(name);
440 try {
441 const auto addeeTimeSeries = addeeWS.run().getTimeSeriesProperty<double>(name);
442 timeSeriesProp->merge(addeeTimeSeries);
443 } catch (std::invalid_argument &) {
444 Types::Core::DateAndTime startTime = addeeWS.run().startTime();
445 double value = addeeWS.run().getLogAsSingleValue(name);
446 timeSeriesProp->addValue(startTime, value);
447 }
448 // Remove this to supress a warning, we will put it back after adding the
449 // workspaces in MergeRuns
450 const Property *addeeWSProperty = addeeWS.run().getProperty(name);
451 m_addeeLogMap.emplace_back(std::shared_ptr<Property>(addeeWSProperty->clone()));
452}
453
464 const std::string &name) {
465 const std::string addeeWSVal = addeeWS.getLog(name)->value();
466 const std::string outWSVal = outWS.run().getProperty(name)->value();
467 outWS.mutableRun().addProperty(name, outWSVal + ", " + addeeWSVal, true);
468}
469
485void SampleLogsBehaviour::checkWarnProperty(const MatrixWorkspace &addeeWS, const Property *addeeWSProperty,
486 const SampleLogBehaviour &behaviour, const double addeeWSNumericValue,
487 const double outWSNumericValue, const std::string &name) {
488
489 if (!isWithinTolerance(behaviour, addeeWSNumericValue, outWSNumericValue) &&
490 !stringPropertiesMatch(behaviour, addeeWSProperty)) {
491 m_logger.warning() << generateDifferenceMessage(name, addeeWS.getName(), addeeWSProperty->value(),
492 behaviour.property->value());
493 }
494}
495
511void SampleLogsBehaviour::checkErrorProperty(const MatrixWorkspace &addeeWS, const Property *addeeWSProperty,
512 const SampleLogBehaviour &behaviour, const double addeeWSNumericValue,
513 const double outWSNumericValue, const std::string &name) {
514
515 if (!isWithinTolerance(behaviour, addeeWSNumericValue, outWSNumericValue) &&
516 !stringPropertiesMatch(behaviour, addeeWSProperty)) {
517 throw std::invalid_argument(
518 generateDifferenceMessage(name, addeeWS.getName(), addeeWSProperty->value(), behaviour.property->value()));
519 }
520}
521
532bool SampleLogsBehaviour::isWithinTolerance(const SampleLogBehaviour &behaviour, const double addeeWSNumericValue,
533 const double outWSNumericValue) {
534 if (behaviour.isNumeric && behaviour.tolerance > 0.0) {
535 return Kernel::withinAbsoluteDifference(addeeWSNumericValue, outWSNumericValue, behaviour.tolerance);
536 }
537
538 return false;
539}
540
549bool SampleLogsBehaviour::stringPropertiesMatch(const SampleLogBehaviour &behaviour, const Property *addeeWSProperty) {
550 return behaviour.property->value() == addeeWSProperty->value();
551}
552
559 for (auto &item : m_logMap) {
560 std::string propertyToReset = item.first.first;
561
562 if (item.first.second == MergeLogType::Warn || item.first.second == MergeLogType::Fail) {
563 continue;
564 }
565
566 const Property *outWSProperty = outWS->run().getProperty(propertyToReset);
567 item.second.property = std::shared_ptr<Property>(outWSProperty->clone());
568 }
569}
570
579 for (const auto &prop : m_addeeLogMap) {
580 const auto &propName = prop->name();
581 addeeWS->mutableRun().removeProperty(propName);
582 }
583}
584
594 for (const auto &item : m_addeeLogMap) {
595 auto property = std::unique_ptr<Kernel::Property>(item->clone());
596 addeeWS->mutableRun().addProperty(std::move(property));
597 }
598 m_addeeLogMap.clear();
599}
600
607 for (auto const &item : m_logMap) {
608 std::string const &propertyToReset = item.first.first;
609
610 if (item.first.second == MergeLogType::TimeSeries) {
611 auto property = std::unique_ptr<Kernel::Property>(item.second.property->clone());
612 ws->mutableRun().addProperty(std::move(property), true);
613 } else if (item.first.second == MergeLogType::Sum || item.first.second == MergeLogType::List) {
614 ws->mutableRun().getProperty(propertyToReset)->setValue(item.second.property->value());
615 }
616 }
617}
618
619} // namespace Mantid::Algorithms
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
double tolerance
Run & mutableRun()
Writable version of the run object.
const Run & run() const
Run details object access.
Geometry::Instrument_const_sptr getInstrument() const
Returns the parameterized instrument.
double getLogAsSingleValue(const std::string &log) const
Access a single value from a log for this experiment.
Kernel::Property * getLog(const std::string &log) const
Access a log for this experiment.
const Types::Core::DateAndTime startTime() const
Return the run start time.
Kernel::Property * getProperty(const std::string &name) const
Returns the named property as a pointer.
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
Definition LogManager.h:91
double getLogAsSingleValue(const std::string &name, Kernel::Math::StatisticType statistic=Kernel::Math::Mean) const
Definition LogManager.h:161
Kernel::TimeSeriesProperty< T > * getTimeSeriesProperty(const std::string &name) const
Returns a property as a time series property.
Base MatrixWorkspace Abstract Class.
const std::string & getName() const override
Get the workspace name.
Definition Workspace.cpp:59
void removeSampleLogsFromWorkspace(const API::MatrixWorkspace_sptr &addeeWS)
When doing a time series merge we need to remove, then add back the sample log in the addee workspace...
std::pair< std::string, MergeLogType > SampleLogsKey
void readdSampleLogToWorkspace(const API::MatrixWorkspace_sptr &addeeWS)
When doing a time series merge we need to remove, then add back the sample log in the addee workspace...
bool setNumericValue(const std::string &item, const API::MatrixWorkspace &ws, double &value)
Tries to set the numeric value of a property.
void updateListProperty(const API::MatrixWorkspace &addeeWS, API::MatrixWorkspace &outWS, const std::string &name)
Perform the update for a list property, appending a new value to the existing string.
std::vector< double > createTolerancesVector(const size_t numberNames, const std::vector< std::string > &tolerances)
Creates a vector of tolerances with the same size as the number of sample logs for the merge type.
std::vector< std::shared_ptr< Kernel::Property > > m_addeeLogMap
SampleLogsBehaviour(const API::MatrixWorkspace_sptr &ws, Kernel::Logger &logger, const SampleLogNames &logEntries={}, ParameterName parName={})
Create and initialise an object that is responsbile for keeping track of the merge types,...
void updateTimeSeriesProperty(const API::MatrixWorkspace &addeeWS, const API::MatrixWorkspace &outWS, const std::string &name)
Perform the update for a time series property, adding a new value to the existing time series propert...
std::map< SampleLogsKey, SampleLogBehaviour > SampleLogsMap
void setUpdatedSampleLogs(const API::MatrixWorkspace_sptr &outWS)
Set the values in the map to be the same as those in the output workspace.
void resetSampleLogs(const API::MatrixWorkspace_sptr &ws)
Resets the sample logs in the workspace to the values in the map.
std::shared_ptr< Kernel::Property > addPropertyForTimeSeries(const std::string &item, const double value, API::MatrixWorkspace &ws)
Adds a property to the workspace provided for a TimeSeries merge type.
bool stringPropertiesMatch(const SampleLogBehaviour &behaviour, const Kernel::Property *addeeWSProperty)
Check if a sample log value in the addee workspace matches one in the first workspace.
std::shared_ptr< Kernel::Property > addPropertyForList(const std::string &item, const std::string &value, API::MatrixWorkspace &ws)
Adds a property to the workspace provided for a List merge type.
void setSampleMap(SampleLogsMap &map, const MergeLogType &, const std::string &params, API::MatrixWorkspace &ws, const std::string &paramsTolerances="", bool skipIfInPrimaryMap=false)
This method updates the map with the sample log behaviour, and adds the new property to the workspace...
void mergeSampleLogs(const API::MatrixWorkspace_sptr &addeeWS, const API::MatrixWorkspace_sptr &outWS)
Create and update sample logs according to instrument parameters.
struct Mantid::Algorithms::SampleLogsBehaviour::ParameterName parameterNames
bool isWithinTolerance(const SampleLogBehaviour &behaviour, const double addeeWSNumber, const double outWSNumber)
Check if a sample log value in the addee workspace is numeric and within tolerances.
void updateSumProperty(double addeeWSNumber, double outWSNumber, API::MatrixWorkspace &outWS, const std::string &name)
Perform the update for a sum property, adding a new value to the existing one.
void checkWarnProperty(const API::MatrixWorkspace &addeeWS, const Kernel::Property *addeeWSProperty, const SampleLogBehaviour &behaviour, const double addeeWSNumber, const double outWSNumber, const std::string &name)
Performs the check to see if a warning should be generated because logs are different.
void checkErrorProperty(const API::MatrixWorkspace &addeeWS, const Kernel::Property *addeeWSProperty, const SampleLogBehaviour &behaviour, const double addeeWSNumber, const double outWSNumber, const std::string &name)
Performs the check to see if an error should be generated because logs are different.
void createSampleLogsMapsFromInstrumentParams(SampleLogsMap &instrumentMap, API::MatrixWorkspace &ws)
Extracts all of the settings from the instrument parameters, and adds them to a map of sample log beh...
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
void error(const std::string &msg)
Logs at error level.
Definition Logger.cpp:108
void warning(const std::string &msg)
Logs at warning level.
Definition Logger.cpp:117
Base class for properties.
Definition Property.h:94
virtual const std::string & units() const
Returns the units of the property, if any, as a string.
Definition Property.cpp:191
virtual void setUnits(const std::string &unit)
Sets the units of the property, as a string.
Definition Property.cpp:198
virtual Property * clone() const =0
'Virtual copy constructor'
virtual std::string value() const =0
Returns the value of the property as a string.
Iterator begin()
Iterator referring to first element in the container.
@ TOK_IGNORE_EMPTY
ignore empty tokens
@ TOK_TRIM
remove leading and trailing whitespace from tokens
Iterator end()
Iterator referring to the past-the-end element in the container.
const TokenVec & asVector()
Returns a vector of tokenized strings.
A specialised Property class for holding a series of time-value pairs.
Mantid::Kernel::StringTokenizer tokenizer
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
MANTID_KERNEL_DLL bool withinAbsoluteDifference(T const x, T const y, S const tolerance)
Test whether x, y are within absolute tolerance tol.
STL namespace.
std::string to_string(const wide_integer< Bits, Signed > &n)