Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into python3-build
Browse files Browse the repository at this point in the history
Conflicts:
	MantidPlot/src/PythonScripting.cpp
  • Loading branch information
martyngigg committed Jun 11, 2016
2 parents 3fa12d8 + cc84f29 commit 023c7d7
Show file tree
Hide file tree
Showing 725 changed files with 7,024 additions and 16,168 deletions.
3 changes: 1 addition & 2 deletions Framework/API/inc/MantidAPI/ITableWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class MANTID_API_DLL ITableWorkspace : public API::Workspace {
throw std::runtime_error(ostr.str());
}
if (row >= this->rowCount()) {
throw std::range_error("Table does not have row " +
boost::lexical_cast<std::string>(row));
throw std::range_error("Table does not have row " + std::to_string(row));
}
return *(static_cast<T *>(c->void_pointer(row)));
}
Expand Down
6 changes: 3 additions & 3 deletions Framework/API/inc/MantidAPI/WorkspaceProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class WorkspaceProperty
* @returns A user level description of the problem or "" if it is valid.
*/
std::string isValidGroup(boost::shared_ptr<WorkspaceGroup> wsGroup) const {
g_log.debug() << " Input WorkspaceGroup found " << std::endl;
g_log.debug() << " Input WorkspaceGroup found \n";

std::vector<std::string> wsGroupNames = wsGroup->getNames();
std::string error;
Expand All @@ -414,7 +414,7 @@ class WorkspaceProperty
"will therefore be ignored as "
"part of the GroupedWorkspace.";

g_log.debug() << error << std::endl;
g_log.debug() << error << '\n';
} else {
// ... and if it is a workspace of incorrect type, exclude the group by
// returning an error.
Expand All @@ -423,7 +423,7 @@ class WorkspaceProperty
Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>::type() +
".";

g_log.debug() << error << std::endl;
g_log.debug() << error << '\n';

return error;
}
Expand Down
18 changes: 8 additions & 10 deletions Framework/API/src/Algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void Algorithm::lockWorkspaces() {
m_writeLockedWorkspaces.end(),
ws) == m_writeLockedWorkspaces.end()) {
// Write-lock it if not already
debugLog << "Write-locking " << ws->getName() << std::endl;
debugLog << "Write-locking " << ws->getName() << '\n';
ws->getLock()->writeLock();
m_writeLockedWorkspaces.push_back(ws);
}
Expand All @@ -373,7 +373,7 @@ void Algorithm::lockWorkspaces() {
m_writeLockedWorkspaces.end(),
ws) == m_writeLockedWorkspaces.end()) {
// Read-lock it if not already write-locked
debugLog << "Read-locking " << ws->getName() << std::endl;
debugLog << "Read-locking " << ws->getName() << '\n';
ws->getLock()->readLock();
m_readLockedWorkspaces.push_back(ws);
}
Expand All @@ -392,13 +392,13 @@ void Algorithm::unlockWorkspaces() {
auto &debugLog = g_log.debug();
for (auto &ws : m_writeLockedWorkspaces) {
if (ws) {
debugLog << "Unlocking " << ws->getName() << std::endl;
debugLog << "Unlocking " << ws->getName() << '\n';
ws->getLock()->unlock();
}
}
for (auto &ws : m_readLockedWorkspaces) {
if (ws) {
debugLog << "Unlocking " << ws->getName() << std::endl;
debugLog << "Unlocking " << ws->getName() << '\n';
ws->getLock()->unlock();
}
}
Expand Down Expand Up @@ -591,8 +591,7 @@ bool Algorithm::execute() {
throw;
else {
getLogger().error() << "Error in execution of algorithm "
<< this->name() << std::endl
<< ex.what() << std::endl;
<< this->name() << '\n' << ex.what() << '\n';
}
notificationCenter().postNotification(
new ErrorNotification(this, ex.what()));
Expand All @@ -603,8 +602,7 @@ bool Algorithm::execute() {
throw;
else {
getLogger().error() << "Logic Error in execution of algorithm "
<< this->name() << std::endl
<< ex.what() << std::endl;
<< this->name() << '\n' << ex.what() << '\n';
}
notificationCenter().postNotification(
new ErrorNotification(this, ex.what()));
Expand Down Expand Up @@ -1068,7 +1066,7 @@ void Algorithm::logAlgorithmInfo() const {
logger.notice() << name() << " started";
if (this->isChild())
logger.notice() << " (child)";
logger.notice() << std::endl;
logger.notice() << '\n';
// Make use of the AlgorithmHistory class, which holds all the info we want
// here
AlgorithmHistory AH(this);
Expand Down Expand Up @@ -1539,7 +1537,7 @@ void Algorithm::reportCompleted(const double &duration,

else {
getLogger().debug() << name() << " finished with isChild = " << isChild()
<< std::endl;
<< '\n';
}
m_running = false;
}
Expand Down
8 changes: 4 additions & 4 deletions Framework/API/src/AlgorithmFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AlgorithmFactoryImpl::AlgorithmFactoryImpl()
// are constructed so that it is destroyed after us and thus does
// not close any loaded DLLs with loaded algorithms in them
Mantid::Kernel::LibraryManager::Instance();
g_log.debug() << "Algorithm Factory created." << std::endl;
g_log.debug() << "Algorithm Factory created.\n";
}

AlgorithmFactoryImpl::~AlgorithmFactoryImpl() {}
Expand Down Expand Up @@ -58,9 +58,9 @@ AlgorithmFactoryImpl::create(const std::string &name,
throw std::runtime_error("algorithm not registered " + name);
else {
g_log.error() << "algorithm " << name << " version " << version
<< " is not registered " << std::endl;
<< " is not registered \n";
g_log.error() << "the latest registered version is " << it->second
<< std::endl;
<< '\n';
throw std::runtime_error("algorithm not registered " +
createName(name, local_version));
}
Expand Down Expand Up @@ -142,7 +142,7 @@ AlgorithmFactoryImpl::decodeName(const std::string &mangledName) const {
ss >> version;

g_log.debug() << "mangled string:" << mangledName << " name:" << name
<< " version:" << version << std::endl;
<< " version:" << version << '\n';
return std::pair<std::string, int>(name, version);
}

Expand Down
9 changes: 4 additions & 5 deletions Framework/API/src/AlgorithmHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,14 @@ AlgorithmHistory::getChildAlgorithm(const size_t index) const {
*/
void AlgorithmHistory::printSelf(std::ostream &os, const int indent) const {
os << std::string(indent, ' ') << "Algorithm: " << m_name;
os << std::string(indent, ' ') << " v" << m_version << std::endl;
os << std::string(indent, ' ') << " v" << m_version << '\n';

os << std::string(indent, ' ')
<< "Execution Date: " << m_executionDate.toFormattedString() << std::endl;
<< "Execution Date: " << m_executionDate.toFormattedString() << '\n';
os << std::string(indent, ' ')
<< "Execution Duration: " << m_executionDuration << " seconds"
<< std::endl;
<< "Execution Duration: " << m_executionDuration << " seconds\n";

os << std::string(indent, ' ') << "Parameters:" << std::endl;
os << std::string(indent, ' ') << "Parameters:\n";

for (const auto &property : m_properties) {
property->printSelf(os, indent + 2);
Expand Down
12 changes: 6 additions & 6 deletions Framework/API/src/AlgorithmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AlgorithmManagerImpl::AlgorithmManagerImpl() : m_managed_algs() {
m_max_no_algs = 100; // Default to keeping 100 algorithms if not specified
}

g_log.debug() << "Algorithm Manager created." << std::endl;
g_log.debug() << "Algorithm Manager created.\n";
}

/** Private destructor
Expand Down Expand Up @@ -92,12 +92,12 @@ IAlgorithm_sptr AlgorithmManagerImpl::create(const std::string &algName,
<< "All algorithms in the AlgorithmManager are running. "
<< "Cannot pop oldest algorithm. "
<< "You should increase your 'algorithms.retained' value. "
<< m_managed_algs.size() << " in queue." << std::endl;
<< m_managed_algs.size() << " in queue.\n";
break;
} else {
// Normal; erase that algorithm
g_log.debug() << "Popping out oldest algorithm " << (*it)->name()
<< std::endl;
<< '\n';
m_managed_algs.erase(it);
}
}
Expand All @@ -108,7 +108,7 @@ IAlgorithm_sptr AlgorithmManagerImpl::create(const std::string &algName,

} catch (std::runtime_error &ex) {
g_log.error() << "AlgorithmManager:: Unable to create algorithm " << algName
<< ' ' << ex.what() << std::endl;
<< ' ' << ex.what() << '\n';
throw std::runtime_error("AlgorithmManager:: Unable to create algorithm " +
algName + ' ' + ex.what());
}
Expand Down Expand Up @@ -163,11 +163,11 @@ void AlgorithmManagerImpl::removeById(AlgorithmID id) {
for (auto it = m_managed_algs.begin(); it != itend; ++it) {
if ((**it).getAlgorithmID() == id) {
if (!(*it)->isRunning()) {
g_log.debug() << "Removing algorithm " << (*it)->name() << std::endl;
g_log.debug() << "Removing algorithm " << (*it)->name() << '\n';
m_managed_algs.erase(it);
} else {
g_log.debug() << "Unable to remove algorithm " << (*it)->name()
<< ". The algorithm is running." << std::endl;
<< ". The algorithm is running.\n";
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/API/src/AnalysisDataService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void AnalysisDataServiceImpl::add(
std::string wsName = ws->name();
// if anonymous make up a name and add
if (wsName.empty()) {
wsName = name + "_" + boost::lexical_cast<std::string>(i + 1);
wsName = name + "_" + std::to_string(i + 1);
} else if (doesExist(wsName)) { // if ws is already there do nothing
wsName.clear();
}
Expand Down Expand Up @@ -120,7 +120,7 @@ void AnalysisDataServiceImpl::addOrReplace(
std::string wsName = ws->name();
// make up a name for an anonymous workspace
if (wsName.empty()) {
wsName = name + "_" + boost::lexical_cast<std::string>(i + 1);
wsName = name + "_" + std::to_string(i + 1);
} else if (doesExist(wsName)) { // if ws is already there do nothing
wsName.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion Framework/API/src/Column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void Column::setPlotType(int t) {
m_plotType = t;
else {
g_log.error() << "Cannot set plot of column to " << t
<< " . Ignore this attempt." << std::endl;
<< " . Ignore this attempt.\n";
}
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/API/src/CompositeFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void CompositeFunction::setUpForFit() {
ParameterTie *tie = getTie(i);
if (tie && !tie->isConstant()) {
g_log.warning() << "Numeric derivatives should be used when "
"non-constant ties defined." << std::endl;
"non-constant ties defined.\n";
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/API/src/DataProcessorAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Workspace_sptr DataProcessorAlgorithm::load(const std::string &inputData,
// The communicator containing all processes
boost::mpi::communicator world;
g_log.notice() << "Chunk/Total: " << world.rank() + 1 << "/"
<< world.size() << std::endl;
<< world.size() << '\n';
loadAlg->setPropertyValue("OutputWorkspace", outputWSName);
loadAlg->setProperty("ChunkNumber", world.rank() + 1);
loadAlg->setProperty("TotalChunks", world.size());
Expand Down Expand Up @@ -391,7 +391,7 @@ boost::shared_ptr<PropertyManager> DataProcessorAlgorithm::getProcessProperties(
processProperties =
PropertyManagerDataService::Instance().retrieve(propertyManagerName);
} else {
getLogger().notice() << "Could not find property manager" << std::endl;
getLogger().notice() << "Could not find property manager\n";
processProperties = boost::make_shared<PropertyManager>();
PropertyManagerDataService::Instance().addOrReplace(propertyManagerName,
processProperties);
Expand Down
9 changes: 4 additions & 5 deletions Framework/API/src/ExperimentInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ ExperimentInfo::getGroupMembers(const detid_t detID) const {
} else {
throw std::runtime_error(
"ExperimentInfo::getGroupMembers - Unable to find ID " +
boost::lexical_cast<std::string>(detID) + " in lookup");
std::to_string(detID) + " in lookup");
}
}

Expand Down Expand Up @@ -814,8 +814,7 @@ ExperimentInfo::getInstrumentFilename(const std::string &instrumentName,
const std::string &date) {
if (date.empty()) {
// Just use the current date
g_log.debug() << "No date specified, using current date and time."
<< std::endl;
g_log.debug() << "No date specified, using current date and time.\n";
const std::string now =
Kernel::DateAndTime::getCurrentTime().toISO8601String();
// Recursively call this method, but with both parameters.
Expand Down Expand Up @@ -887,7 +886,7 @@ ExperimentInfo::getInstrumentFilename(const std::string &instrumentName,
}
}
}
g_log.debug() << "IDF selected is " << mostRecentIDF << std::endl;
g_log.debug() << "IDF selected is " << mostRecentIDF << '\n';
return mostRecentIDF;
}

Expand Down Expand Up @@ -1090,7 +1089,7 @@ std::string ExperimentInfo::loadInstrumentXML(const std::string &filename) {
return Strings::loadFile(filename);
} catch (std::exception &e) {
g_log.error() << "Error loading instrument IDF file: " << filename << ".\n";
g_log.debug() << e.what() << std::endl;
g_log.debug() << e.what() << '\n';
throw;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/API/src/Expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ std::string Expression::GetOp(size_t i) {
void Expression::logPrint(const std::string &pads) const {
std::string myPads = pads + " ";
if (!m_terms.empty()) {
std::cerr << myPads << m_op << '[' << m_funct << ']' << "(" << '\n';
std::cerr << myPads << m_op << '[' << m_funct << ']' << "(\n";
for (const auto &term : m_terms)
term.logPrint(myPads);
std::cerr << myPads << ")" << '\n';
std::cerr << myPads << ")\n";
} else
std::cerr << myPads << m_op << m_funct << '\n';
}
Expand Down
2 changes: 1 addition & 1 deletion Framework/API/src/FileFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ FileFinderImpl::findRuns(const std::string &hintstr) const {
throw std::invalid_argument("Malformed range of runs: " + *h);
}
for (int irun = runNumber; irun <= runEndNumber; ++irun) {
run = boost::lexical_cast<std::string>(irun);
run = std::to_string(irun);
while (run.size() < nZero)
run.insert(0, "0");
std::string path = findRun(p1.first + run);
Expand Down
12 changes: 5 additions & 7 deletions Framework/API/src/FileLoaderRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ searchForLoader(const std::string &filename,
for (auto it = names.begin(); it != iend; ++it) {
const std::string &name = it->first;
const int version = it->second;
logger.debug() << "Checking " << name << " version " << version
<< std::endl;
logger.debug() << "Checking " << name << " version " << version << '\n';

// Use static cast for speed. Checks have been done at registration to check
// the types
Expand All @@ -53,15 +52,15 @@ searchForLoader(const std::string &filename,
try {
const int confidence = alg->confidence(descriptor);
logger.debug() << name << " returned with confidence=" << confidence
<< std::endl;
<< '\n';
if (confidence > maxConfidence) // strictly greater
{
bestLoader = alg;
maxConfidence = confidence;
}
} catch (std::exception &exc) {
logger.warning() << "Checking loader '" << name << "' raised an error: '"
<< exc.what() << "'. Loader skipped." << std::endl;
<< exc.what() << "'. Loader skipped.\n";
}
callback.apply(descriptor);
}
Expand Down Expand Up @@ -100,8 +99,7 @@ FileLoaderRegistryImpl::chooseLoader(const std::string &filename) const {
using Kernel::FileDescriptor;
using Kernel::NexusDescriptor;

m_log.debug() << "Trying to find loader for '" << filename << "'"
<< std::endl;
m_log.debug() << "Trying to find loader for '" << filename << "'\n";

IAlgorithm_sptr bestLoader;
if (NexusDescriptor::isHDF(filename)) {
Expand All @@ -120,7 +118,7 @@ FileLoaderRegistryImpl::chooseLoader(const std::string &filename) const {
throw Kernel::Exception::NotFoundError(filename, "Unable to find loader");
}
m_log.debug() << "Found loader " << bestLoader->name() << " for file '"
<< filename << "'" << std::endl;
<< filename << "'\n";
return bestLoader;
}

Expand Down
Loading

0 comments on commit 023c7d7

Please sign in to comment.