Skip to content

Commit

Permalink
Merge branch 'master' into 11056_loadsqw_v2
Browse files Browse the repository at this point in the history
Conflicts:
	Framework/DataObjects/inc/MantidDataObjects/MDBox.h
	Framework/DataObjects/inc/MantidDataObjects/MDBox.tcc
	Framework/DataObjects/inc/MantidDataObjects/MDGridBox.h
Refs #11056
  • Loading branch information
martyngigg committed Mar 4, 2016
2 parents b59dec8 + 0e00add commit 5b5e2bb
Show file tree
Hide file tree
Showing 4,246 changed files with 112,227 additions and 156,903 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Description of work.

**To test:**

<!-- Instructions for testing. -->

Fixes #xxxx.

[Release notes](/docs/source/release/)
<!-- Replace with a link above to the updated file or state "Does not need to be in the release notes." -->

---

#### Reviewer ####

Please comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):

##### Code Review #####

- [ ] Is the code of an acceptable quality?
- [ ] Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?
- [ ] Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?
- [ ] If there are changes in the release notes then do they describe the changes appropriately?

##### Functional Tests #####

- [ ] Do changes function as described? Add comments below that describe the tests performed?
- [ ] How do the changes handle unexpected situations, e.g. bad input?
- [ ] Has the relevant documentation been added/updated?
- [ ] Is user-facing documentation written in a user-friendly manner?
- [ ] Has developer documentation been updated if required?

- Does everything look good? Comment with the ship it emoji but don't merge. A member of `@mantidproject/gatekeepers` will take care of it.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ local.properties
*.log

# Build results
[Dd]ebug/
[Rr]elease/
build/
/[Rr]elease/
/[Dd]ebug/
*_i.c
*_p.c
*.ilk
Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ else()
cmake_minimum_required ( VERSION 2.8.12 )
endif()

if(POLICY CMP0053)
#Simplify variable reference and escape sequence evaluation.
#Claims to dramatically improve CMake configure and generate time
#requires CMake 3.1 or later
cmake_policy(SET CMP0053 NEW)
endif()

# Define the project name.
project ( Mantid )

Expand Down Expand Up @@ -244,7 +251,7 @@ if ( ENABLE_CPACK )
message ( STATUS " CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )

# rhel requirements
set ( CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.34.1,qt4 >= 4.2,nexus >= 4.3.1,nexus-python >= 4.3.1,gsl,glibc,qwtplot3d-qt4,muParser,numpy" )
set ( CPACK_RPM_PACKAGE_REQUIRES "qt4 >= 4.2,nexus >= 4.3.1,nexus-python >= 4.3.1,gsl,glibc,qwtplot3d-qt4,muParser,numpy" )
# OCE
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization")
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,PyQt4,sip" )
Expand All @@ -255,11 +262,11 @@ if ( ENABLE_CPACK )

if( "${UNIX_CODENAME}" MATCHES "Santiago" )
# On RHEL6 we have to use an updated qscintilla to fix an auto complete bug
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6, boost157" )
# On RHEL6 we are using SCL packages for Qt
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scl-utils,mantidlibs34,mantidlibs34-runtime,mantidlibs34-qt,mantidlibs34-qt-x11,mantidlibs34-qt-webkit,mantidlibs34-qwt5-qt4" )
else()
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4,boost >= 1.53.0" )
endif()

# Add software collections for RHEL
Expand Down
11 changes: 9 additions & 2 deletions Framework/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ set ( SRC_FILES
src/Axis.cpp
src/BinEdgeAxis.cpp
src/BoxController.cpp
src/CatalogFactory.cpp
src/CatalogManager.cpp
src/CatalogSession.cpp
src/ChopperModel.cpp
Expand Down Expand Up @@ -44,8 +43,11 @@ set ( SRC_FILES
src/FunctionParameterDecorator.cpp
src/FunctionProperty.cpp
src/FunctionValues.cpp
src/GeometryInfoFactory.cpp
src/GeometryInfo.cpp
src/GridDomain.cpp
src/GridDomain1D.cpp
src/GroupingLoader.cpp
src/HistogramValidator.cpp
src/HistoryItem.cpp
src/HistoryView.cpp
Expand All @@ -69,7 +71,6 @@ set ( SRC_FILES
src/IPeaksWorkspace.cpp
src/IPowderDiffPeakFunction.cpp
src/ISpectrum.cpp
src/ISplittersWorkspace.cpp
src/ITableWorkspace.cpp
src/IkedaCarpenterModerator.cpp
src/ImmutableCompositeFunction.cpp
Expand Down Expand Up @@ -196,8 +197,11 @@ set ( INC_FILES
inc/MantidAPI/FunctionParameterDecorator.h
inc/MantidAPI/FunctionProperty.h
inc/MantidAPI/FunctionValues.h
inc/MantidAPI/GeometryInfoFactory.h
inc/MantidAPI/GeometryInfo.h
inc/MantidAPI/GridDomain.h
inc/MantidAPI/GridDomain1D.h
inc/MantidAPI/GroupingLoader.h
inc/MantidAPI/HistogramValidator.h
inc/MantidAPI/HistoryItem.h
inc/MantidAPI/HistoryView.h
Expand Down Expand Up @@ -356,6 +360,9 @@ set ( TEST_FILES
FunctionPropertyTest.h
FunctionTest.h
FunctionValuesTest.h
GeometryInfoFactoryTest.h
GeometryInfoTest.h
GroupingLoaderTest.h
HistogramValidatorTest.h
HistoryItemTest.h
HistoryViewTest.h
Expand Down
117 changes: 52 additions & 65 deletions Framework/API/inc/MantidAPI/Algorithm.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#ifndef MANTID_API_ALGORITHM_H_
#define MANTID_API_ALGORITHM_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include <atomic>

#include "MantidAPI/DllConfig.h"
#include "MantidAPI/IAlgorithm.h"
#include "MantidKernel/PropertyManagerOwner.h"
Expand All @@ -12,7 +11,6 @@
#include "MantidAPI/AlgorithmFactory.h" //for the factory macro
#include "MantidAPI/Progress.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidAPI/WorkspaceOpOverloads.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/EmptyValues.h"
Expand Down Expand Up @@ -107,7 +105,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
public:
StartedNotification(const Algorithm *const alg)
: AlgorithmNotification(alg) {} ///< Constructor
virtual std::string name() const {
std::string name() const override {
return "StartedNotification";
} ///< class name
};
Expand All @@ -117,7 +115,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
public:
FinishedNotification(const Algorithm *const alg, bool res)
: AlgorithmNotification(alg), success(res) {} ///< Constructor
virtual std::string name() const {
std::string name() const override {
return "FinishedNotification";
} ///< class name
bool success; ///< true if the finished algorithm was successful or false if
Expand All @@ -134,7 +132,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
int progressPrecision)
: AlgorithmNotification(alg), progress(p), message(msg),
estimatedTime(estimatedTime), progressPrecision(progressPrecision) {}
virtual std::string name() const {
std::string name() const override {
return "ProgressNotification";
} ///< class name
double progress; ///< Current progress. Value must be between 0 and 1.
Expand All @@ -151,7 +149,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
/// Constructor
ErrorNotification(const Algorithm *const alg, const std::string &str)
: AlgorithmNotification(alg), what(str) {}
virtual std::string name() const {
std::string name() const override {
return "ErrorNotification";
} ///< class name
std::string what; ///< message string
Expand All @@ -166,117 +164,113 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
/// and throws CancelException if needed.
class CancelException : public std::exception {
public:
CancelException() : outMessage("Algorithm terminated") {}
CancelException(const CancelException &A)
: outMessage(A.outMessage) {} ///< Copy constructor
/// Assignment operator
CancelException &operator=(const CancelException &A);
/// Destructor
~CancelException() throw() {}

/// Returns the message string.
const char *what() const throw() { return outMessage.c_str(); }
const char *what() const throw() override { return outMessage.c_str(); }

private:
/// The message returned by what()
std::string outMessage;
std::string outMessage{"Algorithm terminated"};
};

//============================================================================
Algorithm();
virtual ~Algorithm();
Algorithm(const Algorithm &) = delete;
Algorithm &operator=(const Algorithm &) = delete;
~Algorithm() override;

/** @name Algorithm Information */
/// function to return a name of the algorithm, must be overridden in all
/// algorithms
virtual const std::string name() const = 0;
const std::string name() const override = 0;
/// function to return a version of the algorithm, must be overridden in all
/// algorithms
virtual int version() const = 0;
int version() const override = 0;
/// function returns a summary message that will be displayed in the default
/// GUI, and in the help.
virtual const std::string summary() const = 0;
const std::string summary() const override = 0;
/// function to return a category of the algorithm. A default implementation
/// is provided
virtual const std::string category() const { return "Misc"; }
const std::string category() const override { return "Misc"; }
/// Function to return all of the categories that contain this algorithm
virtual const std::vector<std::string> categories() const;
const std::vector<std::string> categories() const override;
/// Function to return the separator token for the category string. A default
/// implementation ';' is provided
virtual const std::string categorySeparator() const { return ";"; }
const std::string categorySeparator() const override { return ";"; }
/// function to return any aliases to the algorithm; A default implementation
/// is provided
virtual const std::string alias() const { return ""; }
const std::string alias() const override { return ""; }

const std::string workspaceMethodName() const;
const std::vector<std::string> workspaceMethodOn() const;
const std::string workspaceMethodInputProperty() const;
const std::string workspaceMethodName() const override;
const std::vector<std::string> workspaceMethodOn() const override;
const std::string workspaceMethodInputProperty() const override;

/// Algorithm ID. Unmanaged algorithms return 0 (or NULL?) values. Managed
/// ones have non-zero.
AlgorithmID getAlgorithmID() const { return m_algorithmID; }
AlgorithmID getAlgorithmID() const override { return m_algorithmID; }

/** @name IAlgorithm methods */
void initialize();
bool execute();
void executeAsChildAlg();
virtual std::map<std::string, std::string> validateInputs();
virtual bool isInitialized() const;
virtual bool isExecuted() const;
bool isRunning() const;
void initialize() override;
bool execute() override;
void executeAsChildAlg() override;
std::map<std::string, std::string> validateInputs() override;
bool isInitialized() const override;
bool isExecuted() const override;
bool isRunning() const override;

using Kernel::PropertyManagerOwner::getProperty;

bool isChild() const;
void setChild(const bool isChild);
void enableHistoryRecordingForChild(const bool on);
bool isChild() const override;
void setChild(const bool isChild) override;
void enableHistoryRecordingForChild(const bool on) override;
bool isRecordingHistoryForChild() { return m_recordHistoryForChild; }
void setAlwaysStoreInADS(const bool doStore);
void setRethrows(const bool rethrow);
void setAlwaysStoreInADS(const bool doStore) override;
void setRethrows(const bool rethrow) override;

/** @name Asynchronous Execution */
Poco::ActiveResult<bool> executeAsync();
Poco::ActiveResult<bool> executeAsync() override;

/// Add an observer for a notification
void addObserver(const Poco::AbstractObserver &observer) const;
void addObserver(const Poco::AbstractObserver &observer) const override;

/// Remove an observer
void removeObserver(const Poco::AbstractObserver &observer) const;
void removeObserver(const Poco::AbstractObserver &observer) const override;

/// Raises the cancel flag.
virtual void cancel();
void cancel() override;
/// Returns the cancellation state
bool getCancel() const { return m_cancel; }

/// Returns a reference to the logger.
Kernel::Logger &getLogger() const { return g_log; }
/// Logging can be disabled by passing a value of false
void setLogging(const bool value) { g_log.setEnabled(value); }
void setLogging(const bool value) override { g_log.setEnabled(value); }
/// returns the status of logging, True = enabled
bool isLogging() const { return g_log.getEnabled(); }
bool isLogging() const override { return g_log.getEnabled(); }

/// sets the logging priority offset
void setLoggingOffset(const int value) { g_log.setLevelOffset(value); }
void setLoggingOffset(const int value) override {
g_log.setLevelOffset(value);
}
/// returns the logging priority offset
int getLoggingOffset() const { return g_log.getLevelOffset(); }
int getLoggingOffset() const override { return g_log.getLevelOffset(); }
/// disable Logging of start and end messages
void setAlgStartupLogging(const bool enabled);
void setAlgStartupLogging(const bool enabled) override;
/// get the state of Logging of start and end messages
bool getAlgStartupLogging() const;
bool getAlgStartupLogging() const override;

/// setting the child start progress
void setChildStartProgress(const double startProgress) const {
void setChildStartProgress(const double startProgress) const override {
m_startChildProgress = startProgress;
}
/// setting the child end progress
void setChildEndProgress(const double endProgress) const {
void setChildEndProgress(const double endProgress) const override {
m_endChildProgress = endProgress;
}

/** @name Serialization functions */
//@{
/// Serialize an object to a string
virtual std::string toString() const;
std::string toString() const override;
/// Serialize an object to a json object
::Json::Value toJson() const;
/// De-serialize an object from a string
Expand Down Expand Up @@ -356,9 +350,9 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
virtual void fillHistory();

/// Set to true to stop execution
bool m_cancel;
std::atomic<bool> m_cancel;
/// Set if an exception is thrown, and not caught, within a parallel region
bool m_parallelException;
std::atomic<bool> m_parallelException;

friend class WorkspaceHistory; // Allow workspace history loading to adjust
// g_execCount
Expand Down Expand Up @@ -388,11 +382,6 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
size_t m_groupSize;

private:
/// Private Copy constructor: NO COPY ALLOWED
Algorithm(const Algorithm &);
/// Private assignment operator: NO ASSIGNMENT ALLOWED
Algorithm &operator=(const Algorithm &);

void lockWorkspaces();
void unlockWorkspaces();

Expand Down Expand Up @@ -427,7 +416,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
/// recorded. Applicable to child algs only
bool m_alwaysStoreInADS; ///< Always store in the ADS, even for child algos
bool m_runningAsync; ///< Algorithm is running asynchronously
bool m_running; ///< Algorithm is running
std::atomic<bool> m_running; ///< Algorithm is running
bool m_rethrow; ///< Algorithm should rethrow exceptions while executing
bool m_isAlgStartupLoggingEnabled; /// Whether to log alg startup and
/// closedown messages from the base class
Expand Down Expand Up @@ -459,8 +448,6 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
int m_singleGroup;
/// All the groups have similar names (group_1, group_2 etc.)
bool m_groupsHaveSimilarNames;
/// A non-recursive mutex for thread-safety
mutable Kernel::Mutex m_mutex;
};

/// Typedef for a shared pointer to an Algorithm
Expand Down

0 comments on commit 5b5e2bb

Please sign in to comment.