Skip to content

Commit

Permalink
Merge branch 'master' into feature/10470_grouped_dets_sxdnorm
Browse files Browse the repository at this point in the history
Conflicts:
	Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDNormSXD.h
	Code/Mantid/Framework/MDAlgorithms/src/MDNormSXD.cpp

Refs #10470
  • Loading branch information
martyngigg committed Nov 20, 2014
2 parents c16f78c + 107d05e commit c724725
Show file tree
Hide file tree
Showing 454 changed files with 23,920 additions and 10,607 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: LLVM

2 changes: 2 additions & 0 deletions Code/Mantid/Build/CMake/DarwinSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ file ( GLOB THIRDPARTY_PYTHON_PACKAGES ${CMAKE_LIBRARY_PATH}/Python/* )
foreach ( PYPACKAGE ${THIRDPARTY_PYTHON_PACKAGES} )
if ( IS_DIRECTORY ${PYPACKAGE} )
install ( DIRECTORY ${PYPACKAGE} DESTINATION ${BIN_DIR} )
else()
install ( FILES ${PYPACKAGE} DESTINATION ${BIN_DIR} )
endif()
file ( COPY ${PYPACKAGE} DESTINATION ${PROJECT_BINARY_DIR}/bin )
endforeach( PYPACKAGE )
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/FindTcmalloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# TCMALLOC_FOUND If false, do not try to use TCMALLOC

find_path ( TCMALLOC_INCLUDE_DIR tcmalloc.h
PATHS /usr/include/google
PATHS /usr/include/gperftools
)

find_library ( TCMALLOC_LIB NAMES tcmalloc tcmalloc_minimal )
Expand Down
28 changes: 14 additions & 14 deletions Code/Mantid/Build/CMake/MantidUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,29 @@ endfunction( SET_TARGET_OUTPUT_DIRECTORY )
#######################################################################

#
# NAME: COPY_PYTHON_FILES_TO_DIR
# Adds a set of custom commands for each python file to copy
# NAME: COPY_FILES_TO_DIR
# Adds a set of custom commands for each file to copy
# the given file to the destination directory
# - PY_FILES :: A list of python files to copy. Note you will have
# - FILES :: A list of files to copy. Note you will have
# to quote an expanded list
# - SRC_DIR :: The src directory of the files to be copied
# - DEST_DIR :: The final directory for the copied files
# - INSTALLED_FILES :: An output variable containing the list of copied
# files including their full paths
function( COPY_PYTHON_FILES_TO_DIR PY_FILES SRC_DIR DEST_DIR INSTALLED_FILES )
function( COPY_FILES_TO_DIR FILES SRC_DIR DEST_DIR INSTALLED_FILES )
set ( COPIED_FILES ${${INSTALLED_FILES}} )
foreach ( PYFILE ${PY_FILES} )
get_filename_component( _basefilename ${PYFILE} NAME_WE )
set( _py_src ${SRC_DIR}/${PYFILE} )
set( _py_bin ${DEST_DIR}/${PYFILE} )
add_custom_command ( OUTPUT ${_py_bin}
DEPENDS ${_py_src}
foreach ( _FILE ${FILES} )
get_filename_component( _basefilename ${_FILE} NAME_WE )
set( _src ${SRC_DIR}/${_FILE} )
set( _bin ${DEST_DIR}/${_FILE} )
add_custom_command ( OUTPUT ${_bin}
DEPENDS ${_src}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different
${_py_src} ${_py_bin} )
set ( COPIED_FILES ${COPIED_FILES} ${_py_bin} )
endforeach ( PYFILE )
${_src} ${_bin} )
set ( COPIED_FILES ${COPIED_FILES} ${_bin} )
endforeach ( _FILE )
set ( ${INSTALLED_FILES} ${COPIED_FILES} PARENT_SCOPE )
endfunction( COPY_PYTHON_FILES_TO_DIR )
endfunction( COPY_FILES_TO_DIR )

#######################################################################

Expand Down
9 changes: 7 additions & 2 deletions Code/Mantid/Build/CMake/UseSystemQt4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
# License text for the above reference.)

ADD_DEFINITIONS(${QT_DEFINITIONS})
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.9)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:QT_DEBUG>)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
ELSE()
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
ENDIF()
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)

Expand Down
17 changes: 11 additions & 6 deletions Code/Mantid/Build/paraview-deb-packaging/README
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
--Author: Owen Arnold
--Date: 06/March/2012
--Date: 06/March/2012, updated 14/Nov/2014

Info:
The bash script in this directory is used to build and package ParaView to Debian packages for Ubuntu platforms.
At the time of writing custom deployment is necessary for these reasons:
At the time of writing custom deployment is necessary for two reasons:

1) Current versions of Ubuntu distribute much older versions of ParaView from their repositories
2) The distributed source version of ParaView 3.10.1 contains bugs which we have fixed in our modified source code. This script can be used with our patched source. Currently available at http://download.mantidproject.org/VatesDownload.psp
3) The default ParaView packaging puts libraries in subdirectories of lib and they therefore cannot be found by Mantid without manually modifying the LD_LIBRARY_PATH. This packaging script will fix that issue.
1) We distribute a slightly modified source version of ParaView 3.98.1. This script can be used with our patched source.
Currently available at http://download.mantidproject.org
2) The default ParaView packaging puts libraries in subdirectories of lib and they therefore cannot be found by Mantid
without manually modifying the LD_LIBRARY_PATH. This packaging script will fix that issue.

Usage:
In order to build the binary packages. Place the *.tar.gz paraview source compressed file from http://download.mantidproject.org/VatesDownload.psp into an empty directory. Copy the accompanying *.sh script associated with this README into the same directory. Run the bash script. The packaged .*Deb binaries will appear in the /paraview/install directory at the end of the process.

- In order to build the binary packages. Place the *.tar.gz paraview source compressed file from
http://download.mantidproject.org into an empty directory.

- Copy the accompanying *.sh script associated with this README into the same directory. Run the bash script.
The packaged .*Deb binaries will appear in the /paraview/install directory at the end of the process.
4 changes: 2 additions & 2 deletions Code/Mantid/Build/paraview-deb-packaging/build_and_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ PV_LOC=paraview

PV_PKG=ParaView

PV_VER=3.10.1
PV_VER=3.98.1

PV_NAME=${PV_PKG}-${PV_VER}-patched
PV_NAME=${PV_PKG}-${PV_VER}-source

PV_SRC=${PV_NAME}.tar.gz

Expand Down
19 changes: 10 additions & 9 deletions Code/Mantid/Framework/API/inc/MantidAPI/Column.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#ifndef Q_MOC_RUN
# include <boost/shared_ptr.hpp>
#endif
#include <cstring>
#include <string>
#include <typeinfo>
#include <limits>
#include <typeinfo>
#include <vector>

namespace Mantid
Expand Down Expand Up @@ -114,7 +115,7 @@ class MANTID_API_DLL Column
{
return *static_cast<T*>(void_pointer(index));
}


/// Templated method for returning a value (const version). No type checks are done.
template<class T>
Expand All @@ -127,17 +128,17 @@ class MANTID_API_DLL Column
template<class T>
bool isType()const
{
return get_type_info() == typeid(T);
return !std::strcmp(get_type_info().name(), typeid(T).name());
}

/// get plot type
/// @return See description of setPlotType() for the interpretation of the returned int
/// get plot type
/// @return See description of setPlotType() for the interpretation of the returned int
int getPlotType() const
{
return m_plotType;
}

/// Set plot type where
/// Set plot type where
void setPlotType(int t);

/**
Expand Down Expand Up @@ -169,7 +170,7 @@ class MANTID_API_DLL Column
std::string m_name;///< name
std::string m_type;///< type

/// plot type where
/// plot type where
/// None = 0 (means it has specifically been set to 'no plot type')
/// NotSet = -1000 (this is the default and means plot style has not been set)
/// X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6
Expand All @@ -184,7 +185,7 @@ class MANTID_API_DLL Column
};

/** @class Boolean
As TableColumn stores its data in a std::vector bool type cannot be used
As TableColumn stores its data in a std::vector bool type cannot be used
in the same way as the other types. Class Boolean is used instead.
*/
struct MANTID_API_DLL Boolean
Expand All @@ -197,7 +198,7 @@ struct MANTID_API_DLL Boolean
operator bool(){return value;}
/// equal to operator
bool operator==(const Boolean& b)const
{return(this->value==b.value);
{return(this->value==b.value);
}
//
operator double(void)const{return double(this->value);}
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/HistoryView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/HistoryItem.h"
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidKernel/DateAndTime.h"

#include <list>
#include <vector>
Expand Down Expand Up @@ -55,13 +56,14 @@ class MANTID_API_DLL HistoryView
void unrollAll();
void roll(size_t index);
void rollAll();
void filterBetweenExecDate(Mantid::Kernel::DateAndTime start, Mantid::Kernel::DateAndTime end = Mantid::Kernel::DateAndTime::getCurrentTime());
const std::vector<HistoryItem> getAlgorithmsList() const;
size_t size() const { return m_historyItems.size(); }

private:
void unroll(std::list<HistoryItem>::iterator it);
void roll(std::list<HistoryItem>::iterator it);

const WorkspaceHistory m_wsHist;
std::list<HistoryItem> m_historyItems;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ class MANTID_API_DLL IPowderDiffPeakFunction : public virtual API::ParamFunction

size_t LATTICEINDEX;
size_t HEIGHTINDEX;

private:
/// Peak intensity
double m_intensity;

};

typedef boost::shared_ptr<IPowderDiffPeakFunction> IPowderDiffPeakFunction_sptr;
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ namespace Mantid
/// Create an image of Es.
MantidImage_sptr getImageE (size_t start = 0, size_t stop = 0, size_t width = 0, double startX = EMPTY_DBL(), double endX = EMPTY_DBL() ) const;
/// Copy the data (Y's) from an image to this workspace.
void setImageY( const MantidImage &image, size_t start = 0 );
virtual void setImageY( const MantidImage &image, size_t start = 0, bool parallelExecution=true);
/// Copy the data from an image to this workspace's errors.
void setImageE( const MantidImage &image, size_t start = 0 );
virtual void setImageE( const MantidImage &image, size_t start = 0, bool parallelExecution=true );

//=====================================================================================
// End image methods
Expand All @@ -361,7 +361,7 @@ namespace Mantid
/// Create an MantidImage instance.
MantidImage_sptr getImage(const MantidVec& (MatrixWorkspace::*read)(std::size_t const) const, size_t start, size_t stop, size_t width, size_t indexStart, size_t indexEnd) const;
/// Copy data from an image.
void setImage( MantidVec& (MatrixWorkspace::*dataVec)(const std::size_t), const MantidImage &image, size_t start );
void setImage( MantidVec& (MatrixWorkspace::*dataVec)(const std::size_t), const MantidImage &image, size_t start, bool parallelExecution );

/// Has this workspace been initialised?
bool m_isInitialized;
Expand Down
38 changes: 38 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceValidators.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,44 @@ class DLLExport IncreasingAxisValidator : public MatrixWorkspaceValidator
}
};

//===============================================================================================
/**
* A validator which checks whether data in each spectrum of the input workspace are monotonically increasing.
*/
class DLLExport IncreasingDataValidator : public MatrixWorkspaceValidator
{
public:
///Gets the type of the validator
std::string getType() const { return "increasingdata"; }
/// Clone the current state
Kernel::IValidator_sptr clone() const { return boost::make_shared<IncreasingDataValidator>(*this); }

private:
/** Validate a workspace.
* @param value :: The workspace to test
* @return A message for users with negative results, otherwise ""
*/
std::string checkValidity( const MatrixWorkspace_sptr& value ) const
{
if ( value->blocksize() < 2 )
{
return "Spectra must have two or more data points (bins).";
}
for(size_t spec = 0; spec < value->getNumberHistograms(); ++spec)
{
auto &Y = value->readY( spec );
double y = Y.front();
for(auto it = Y.begin() + 1; it != Y.end(); ++it)
{
if ( y > *it ) return "Data in the workspace must monotonically increase.";
y = *it;
}
}
return "";
}

};

} // namespace API
} // namespace Mantid

Expand Down

0 comments on commit c724725

Please sign in to comment.