Commit cb50a48b authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #25841 clang format

parent 4f448c6c
......@@ -51,8 +51,8 @@ void Algorithm::declareWorkspaceInputProperties(const std::string &propertyName,
auto indexTypePropName =
IndexTypeProperty::generatePropertyName(propertyName);
auto indexTypeProp = std::make_unique<IndexTypeProperty>(
indexTypePropName, AllowedIndexTypes);
auto indexTypeProp =
std::make_unique<IndexTypeProperty>(indexTypePropName, AllowedIndexTypes);
const auto &indexTypePropRef = *indexTypeProp;
declareProperty(std::move(indexTypeProp),
......@@ -61,7 +61,7 @@ void Algorithm::declareWorkspaceInputProperties(const std::string &propertyName,
auto indexPropName = IndexProperty::generatePropertyName(propertyName);
declareProperty(std::make_unique<IndexProperty>(indexPropName, wsPropRef,
indexTypePropRef),
indexTypePropRef),
"An optional set of spectra that will be processed by the "
"algorithm; If not set, all spectra will be processed; The "
"indices in this list can be workspace indices or possibly "
......
......@@ -211,9 +211,8 @@ using LogManager_const_sptr = boost::shared_ptr<const LogManager>;
template <class TYPE>
void LogManager::addProperty(const std::string &name, const TYPE &value,
bool overwrite) {
addProperty(
std::make_unique<Kernel::PropertyWithValue<TYPE>>(name, value),
overwrite);
addProperty(std::make_unique<Kernel::PropertyWithValue<TYPE>>(name, value),
overwrite);
}
/**
......@@ -228,8 +227,7 @@ void LogManager::addProperty(const std::string &name, const TYPE &value,
template <class TYPE>
void LogManager::addProperty(const std::string &name, const TYPE &value,
const std::string &units, bool overwrite) {
auto newProp =
std::make_unique<Kernel::PropertyWithValue<TYPE>>(name, value);
auto newProp = std::make_unique<Kernel::PropertyWithValue<TYPE>>(name, value);
newProp->setUnits(units);
addProperty(std::move(newProp), overwrite);
}
......
......@@ -40,7 +40,6 @@
#include "MantidKernel/StringTokenizer.h"
#include "MantidKernel/Strings.h"
#include "MantidTypes/SpectrumDefinition.h"
#include <boost/algorithm/string.hpp>
......
......@@ -31,7 +31,6 @@
#include "MantidKernel/Strings.h"
#include "MantidKernel/UnitFactory.h"
#include <boost/lexical_cast.hpp>
#include "MantidKernel/StringTokenizer.h"
......
......@@ -9,7 +9,6 @@
#include "MantidKernel/Logger.h"
#include "MantidKernel/TimeSeriesProperty.h"
using Mantid::Kernel::LogFilter;
using Mantid::Kernel::Property;
using Mantid::Kernel::TimeSeriesProperty;
......
......@@ -1678,7 +1678,7 @@ std::vector<std::unique_ptr<IMDIterator>> MatrixWorkspace::createIterators(
if (end > numElements)
end = numElements;
out.push_back(std::make_unique<MatrixWorkspaceMDIterator>(this, function,
begin, end));
begin, end));
}
return out;
}
......
......@@ -12,7 +12,6 @@
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/VectorHelper.h"
#include <nexus/NeXusFile.hpp>
#include <boost/lexical_cast.hpp>
......@@ -49,8 +48,8 @@ Kernel::Logger g_log("Run");
Run::Run() : m_goniometer(std::make_unique<Geometry::Goniometer>()) {}
Run::Run(const Run &other)
: LogManager(other), m_goniometer(std::make_unique<Geometry::Goniometer>(
*other.m_goniometer)),
: LogManager(other),
m_goniometer(std::make_unique<Geometry::Goniometer>(*other.m_goniometer)),
m_histoBins(other.m_histoBins) {}
// Defined as default in source for forward declaration with std::unique_ptr.
......
......@@ -9,7 +9,6 @@
#include "MantidKernel/IPropertyManager.h"
#include "MantidKernel/Memory.h"
namespace Mantid {
namespace API {
......
......@@ -9,7 +9,6 @@
#include "MantidAPI/WorkspaceNearestNeighbours.h"
#include "MantidGeometry/IDetector.h"
namespace Mantid {
namespace API {
......
......@@ -59,7 +59,7 @@ public:
void init() override {
declareProperty(std::make_unique<WorkspaceProperty<>>("InputWorkspace", "",
Direction::Input));
Direction::Input));
}
void exec() override {}
......
......@@ -47,14 +47,14 @@ public:
void init() override {
declareProperty(std::make_unique<WorkspaceProperty<>>("InputWorkspace1", "",
Direction::Input));
Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>(
"InputWorkspace2", "", Direction::Input, PropertyMode::Optional));
declareProperty(std::make_unique<WorkspaceProperty<>>(
"InOutWorkspace", "", Direction::InOut, PropertyMode::Optional));
declareProperty("Number", 0.0);
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace1", "",
Direction::Output));
declareProperty(std::make_unique<WorkspaceProperty<>>(
"OutputWorkspace1", "", Direction::Output));
declareProperty(std::make_unique<WorkspaceProperty<>>(
"OutputWorkspace2", "", Direction::Output, PropertyMode::Optional));
}
......@@ -151,7 +151,7 @@ public:
void init() override {
declareProperty(std::make_unique<WorkspaceProperty<>>("InputWorkspace", "",
Direction::Input));
Direction::Input));
declareProperty("WsNameToFail", "");
}
......@@ -180,9 +180,8 @@ public:
void init() override {
declareWorkspaceInputProperties<MatrixWorkspace>("InputWorkspace", "");
declareProperty(
std::make_unique<WorkspaceProperty<MatrixWorkspace>>(
"InputWorkspace2", "", Mantid::Kernel::Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<MatrixWorkspace>>(
"InputWorkspace2", "", Mantid::Kernel::Direction::Input));
declareWorkspaceInputProperties<
MatrixWorkspace, IndexType::SpectrumNum | IndexType::WorkspaceIndex>(
"InputWorkspace3", "");
......
......@@ -48,23 +48,21 @@ public:
PropertyManagerOwner alg;
// Start with a regular property
alg.declareProperty(std::make_unique<WorkspaceProperty<>>("InputWorkspace", "",
Direction::Input));
alg.declareProperty(std::make_unique<WorkspaceProperty<>>(
"InputWorkspace", "", Direction::Input));
// Make a property with its validator. Will be enabled when that other one
// is NOT the default
alg.declareProperty("MyValidatorProp", 456);
alg.setPropertySettings(
"MyValidatorProp",
std::make_unique<
EnabledWhenWorkspaceIsType<WorkspaceTesterSubClass>>(
std::make_unique<EnabledWhenWorkspaceIsType<WorkspaceTesterSubClass>>(
"InputWorkspace", true));
alg.declareProperty("MyValidatorProp2", 456);
alg.setPropertySettings(
"MyValidatorProp2",
std::make_unique<
EnabledWhenWorkspaceIsType<WorkspaceTesterSubClass>>(
std::make_unique<EnabledWhenWorkspaceIsType<WorkspaceTesterSubClass>>(
"InputWorkspace", false));
Property *prop = alg.getPointerToProperty("MyValidatorProp");
......
......@@ -145,8 +145,7 @@ private:
ws->setCountStandardDeviations(0, errors);
// Create the log to be filtered
auto log =
std::make_unique<TimeSeriesProperty<double>>("TestLog");
auto log = std::make_unique<TimeSeriesProperty<double>>("TestLog");
constexpr size_t logSize(12);
const DateAndTime initialTime("2007-11-30T16:17:00");
std::vector<DateAndTime> times;
......@@ -164,8 +163,7 @@ private:
// Status ("running") log
if (hasStatusLog) {
auto status =
std::make_unique<TimeSeriesProperty<bool>>("running");
auto status = std::make_unique<TimeSeriesProperty<bool>>("running");
status->addValue(initialTime, true);
status->addValue(initialTime + 30.0, false);
status->addValue(initialTime + 60.0, true);
......@@ -174,8 +172,7 @@ private:
// Period log
if (hasPeriodLog) {
auto period =
std::make_unique<TimeSeriesProperty<bool>>("period 1");
auto period = std::make_unique<TimeSeriesProperty<bool>>("period 1");
period->addValue(initialTime + 80.0, true);
period->addValue(initialTime + 110.0, false);
ws->mutableRun().addLogData(std::move(period));
......@@ -183,8 +180,7 @@ private:
// Log that isn't a numeric TSP
if (hasBadLog) {
auto bad = std::make_unique<TimeSeriesProperty<std::string>>(
"BadLog");
auto bad = std::make_unique<TimeSeriesProperty<std::string>>("BadLog");
bad->addValue(initialTime + 15.0, "hello");
bad->addValue(initialTime + 45.0, "string");
ws->mutableRun().addLogData(std::move(bad));
......
......@@ -31,7 +31,7 @@ public:
declareProperty(
std::make_unique<ArrayProperty<std::string>>("MyInputWorkspaces"));
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
Direction::Output),
"");
declareProperty(
"PropertyA", 1,
......@@ -67,14 +67,14 @@ public:
int version() const override { return 1; }
const std::string summary() const override { return "Test summary"; }
void init() override {
declareProperty(
std::make_unique<WorkspaceProperty<>>("PropertyA", "ws1", Direction::Input));
declareProperty(
std::make_unique<WorkspaceProperty<>>("PropertyB", "ws2", Direction::Input));
declareProperty(
std::make_unique<WorkspaceProperty<>>("PropertyC", "ws3", Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>("PropertyA", "ws1",
Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>("PropertyB", "ws2",
Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>("PropertyC", "ws3",
Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
Direction::Output),
"");
declareProperty(
"PropertyX", 1,
......@@ -134,8 +134,8 @@ public:
declareProperty(std::make_unique<WorkspaceProperty<WorkspaceGroup>>(
"InputWorkspaces", "", Direction::Input),
"");
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
declareProperty(std::make_unique<WorkspaceProperty<>>(
"OutputWorkspace", "", Direction::Output),
"");
}
void exec() override {
......@@ -174,8 +174,8 @@ public:
void init() override {
declareProperty(
std::make_unique<ArrayProperty<std::string>>("InputWorkspaces"));
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
declareProperty(std::make_unique<WorkspaceProperty<>>(
"OutputWorkspace", "", Direction::Output),
"Name of the output workspace");
}
void exec() override {
......
......@@ -25,10 +25,10 @@ public:
int version() const override { return 1; }
const std::string summary() const override { return "Test summary"; }
void init() override {
declareProperty(std::make_unique<ArrayProperty<std::string>>("MyInputWorkspaces",
Direction::Input));
declareProperty(std::make_unique<ArrayProperty<std::string>>(
"MyInputWorkspaces", Direction::Input));
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
Direction::Output),
"");
}
void exec() override {
......
......@@ -7,12 +7,12 @@
#ifndef MANTID_ALGORITHMS_MERGERUNS_H_
#define MANTID_ALGORITHMS_MERGERUNS_H_
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/MultiPeriodGroupAlgorithm.h"
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidGeometry/Instrument/DetectorInfo.h"
#include "MantidKernel/System.h"
#include "MantidAPI/MatrixWorkspace.h"
#include <boost/optional.hpp>
......
......@@ -7,8 +7,8 @@
#ifndef MANTID_ALGORITHMS_MERGERUNS_SAMPLELOGSBEHAVIOUR_H_
#define MANTID_ALGORITHMS_MERGERUNS_SAMPLELOGSBEHAVIOUR_H_
#include "MantidAlgorithms/DllConfig.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "MantidAlgorithms/DllConfig.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/Property.h"
......
......@@ -76,11 +76,11 @@ void AbsorptionCorrection::init() {
wsValidator->add<InstrumentValidator>();
declareProperty(
std::make_unique<WorkspaceProperty<>>("InputWorkspace", "", Direction::Input,
wsValidator),
std::make_unique<WorkspaceProperty<>>("InputWorkspace", "",
Direction::Input, wsValidator),
"The X values for the input workspace must be in units of wavelength");
declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "",
Direction::Output),
Direction::Output),
"Output workspace name");
// AbsorbedBy
......
......@@ -30,7 +30,8 @@ DECLARE_ALGORITHM(AddLogDerivative)
*/
void AddLogDerivative::init() {
declareProperty(
std::make_unique<WorkspaceProperty<>>("InputWorkspace", "", Direction::InOut),
std::make_unique<WorkspaceProperty<>>("InputWorkspace", "",
Direction::InOut),
"An input/output workspace. The new log will be added to it.");
declareProperty(
"LogName", "", boost::make_shared<MandatoryValidator<std::string>>(),
......
......@@ -129,7 +129,7 @@ void AlignDetectors::init() {
const std::vector<std::string> exts{".h5", ".hd5", ".hdf", ".cal"};
declareProperty(
std::make_unique<FileProperty>("CalibrationFile", "",
FileProperty::OptionalLoad, exts),
FileProperty::OptionalLoad, exts),
"Optional: The .cal file containing the position correction factors. "
"Either this or OffsetsWorkspace needs to be specified.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment