Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/7840_c2e_ad…
Browse files Browse the repository at this point in the history
…d_scale_to_res

Conflicts:
	Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ConvertToEnergy.ui

Refs #7840
  • Loading branch information
Samuel Jackson committed Oct 21, 2013
2 parents 866efd8 + fc3f1b4 commit 05a3ff6
Show file tree
Hide file tree
Showing 321 changed files with 16,073 additions and 4,177 deletions.
1 change: 0 additions & 1 deletion Code/Mantid/Build/CMake/CPackCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Neutron Scattering Data Analysis" )
set ( CPACK_PACKAGE_VENDOR "ISIS Rutherford Appleton Laboratory and NScD Oak Ridge National Laboratory" )
set ( CPACK_PACKAGE_URL http://www.mantidproject.org/ )
set ( CPACK_PACKAGE_CONTACT mantid-help@mantidproject.org )
include ( PatchVersionNumber )
set ( CPACK_PACKAGE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} )
set ( CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} )
set ( CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} )
Expand Down
26 changes: 12 additions & 14 deletions Code/Mantid/Build/CMake/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ endif()
# Also makes sure our commit hooks are linked in the right place.
###########################################################################

set ( MtdVersion_WC_LAST_CHANGED_REV 0 )
set ( MtdVersion_WC_LAST_CHANGED_DATE Unknown )
set ( MtdVersion_WC_LAST_CHANGED_DATETIME 0 )
set ( NOT_GIT_REPO "Not" )
Expand All @@ -94,14 +93,12 @@ if ( GIT_FOUND )
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
if ( NOT NOT_GIT_REPO ) # i.e This is a git repository!

# Remove the tag name part
string ( REGEX MATCH "[-](.*)" MtdVersion_WC_LAST_CHANGED_REV ${GIT_DESCRIBE} )
# Extract the SHA1 part (with a 'g' prefix which stands for 'git')
# N.B. The variable comes back from 'git describe' with a line feed on the end, so we need to lose that
string ( REGEX MATCH "(g.*)[^\n]" MtdVersion_WC_LAST_CHANGED_SHA ${MtdVersion_WC_LAST_CHANGED_REV} )
# Get the number part (number of commits since tag)
string ( REGEX MATCH "[0-9]+" MtdVersion_WC_LAST_CHANGED_REV ${MtdVersion_WC_LAST_CHANGED_REV} )

# Get the date of the last commit
execute_process ( COMMAND ${GIT_EXECUTABLE} log -1 --format=format:%cD OUTPUT_VARIABLE MtdVersion_WC_LAST_CHANGED_DATE
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
Expand Down Expand Up @@ -190,27 +187,28 @@ else()
message ( STATUS "Git not found - using dummy revision number and date" )
endif()

mark_as_advanced( MtdVersion_WC_LAST_CHANGED_REV MtdVersion_WC_LAST_CHANGED_DATE
MtdVersion_WC_LAST_CHANGED_DATETIME )
mark_as_advanced( MtdVersion_WC_LAST_CHANGED_DATE MtdVersion_WC_LAST_CHANGED_DATETIME )

###########################################################################
# Include the file that contains the version number
# This must come after the git describe business above because it can be
# used to override the patch version number (MtdVersion_WC_LAST_CHANGED_REV)
###########################################################################

include ( VersionNumber )

if ( NOT NOT_GIT_REPO ) # i.e This is a git repository!
###########################################################################
# Create the file containing the patch version number for use by cpack
# The patch number make have been overridden by VerisonNumber so create
# The patch number make have been overridden by VersionNumber so create
# the file used by cpack here
###########################################################################
configure_file ( ${GIT_TOP_LEVEL}/Code/Mantid/Build/CMake/PatchVersionNumber.cmake.in
${GIT_TOP_LEVEL}/Code/Mantid/Build/CMake/PatchVersionNumber.cmake )
include ( PatchVersionNumber )
endif()

###########################################################################
# Include the file that contains the version number
# This must come after the git describe business above because it can be
# used to override the patch version number (MtdVersion_WC_LAST_CHANGED_REV)
###########################################################################
include ( VersionNumber )


###########################################################################
# Look for OpenMP and set compiler flags if found
###########################################################################
Expand Down
10 changes: 7 additions & 3 deletions Code/Mantid/Build/CMake/DarwinSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ set ( PVPLUGINS_DIR MantidPlot.app/pvplugins )
set ( PVPLUGINS_SUBDIR pvplugins ) # Need to tidy these things up!

# Python packages
set ( PYTHON_PACKAGES_DIR ${CMAKE_LIBRARY_PATH}/Python )

install ( PROGRAMS /Library/Python/${PY_VER}/site-packages/sip.so DESTINATION ${BIN_DIR} )
# Explicitly specify which PyQt libraries we want because just taking the whole
Expand All @@ -75,8 +74,13 @@ install ( FILES /Library/Python/${PY_VER}/site-packages/PyQt4/Qt.so
/Library/Python/${PY_VER}/site-packages/PyQt4/__init__.py
DESTINATION ${BIN_DIR}/PyQt4 )
install ( DIRECTORY /Library/Python/${PY_VER}/site-packages/PyQt4/uic DESTINATION ${BIN_DIR}/PyQt4 )
# nxs package
install ( DIRECTORY ${PYTHON_PACKAGES_DIR}/nxs DESTINATION ${BIN_DIR} )

# Python packages in Third_Party need copying to build directory and the final package
file ( GLOB THIRDPARTY_PYTHON_PACKAGES ${CMAKE_LIBRARY_PATH}/Python/* )
foreach ( PYPACKAGE ${THIRDPARTY_PYTHON_PACKAGES} )
install ( DIRECTORY ${PYPACKAGE} DESTINATION ${BIN_DIR} )
file ( COPY ${PYPACKAGE} DESTINATION ${PROJECT_BINARY_DIR}/bin )
endforeach( PYPACKAGE )

install ( DIRECTORY ${QT_PLUGINS_DIR}/imageformats DESTINATION MantidPlot.app/Contents/Frameworks/plugins )

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/VersionNumber.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set ( VERSION_MINOR 6 )
# UNCOMMENT the next 'set' line to 'force' the patch version number to
# a value (instead of using the count coming out of 'git describe')
# DO NOT COMMIT THIS TO MASTER UNCOMMENTED, ONLY TO A RELEASE BRANCH
#set ( MtdVersion_WC_LAST_CHANGED_REV 1 )
#set ( VERSION_PATCH 0 )

8 changes: 5 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ namespace Mantid
{
public:
std::string getFullPath(const std::string& filename)const;
std::string getPath(const std::vector<IArchiveSearch_sptr>& archs, const std::set<std::string>& filename, const std::vector<std::string>& extensions)const;
std::string getPath(const std::vector<IArchiveSearch_sptr>& archs, const std::set<std::string>& filename,
const std::vector<std::string>& extensions)const;
/// DO NOT USE! MADE PUBLIC FOR TESTING ONLY.
std::string makeFileName(const std::string& hint, const Kernel::InstrumentInfo& instrument)const;
void setCaseSensitive(const bool cs);
bool getCaseSensitive() const;
std::string findRun(const std::string& hintstr,const std::set<std::string> *exts)const;
std::string findRun(const std::string& hintstr,const std::vector<std::string> &exts = std::vector<std::string>())const;
std::string findRun(const std::string& hintstr,const std::set<std::string> & exts)const;
std::string findRun(const std::string& hintstr,
const std::vector<std::string> &exts = std::vector<std::string>())const;
std::vector<std::string> findRuns(const std::string& hintstr)const;
/// DO NOT USE! MADE PUBLIC FOR TESTING ONLY.
const Kernel::InstrumentInfo getInstrument(const std::string& hint) const;
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/LogManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ namespace Mantid

/// Empty the values out of all TimeSeriesProperty logs
void clearTimeSeriesLogs();
/// Empty all but the last value out of all TimeSeriesProperty logs
void clearOutdatedTimeSeriesLogValues();

/// Save the run to a NeXus file with a given group name
virtual void saveNexus(::NeXus::File * file, const std::string & group,bool keepOpen=false) const;
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,12 @@ They will work as was expected for folders @ref folders-sec.
@param option: flag to set for auto-update, or not. If true, new versions of the path will replace the local file as soon as they are available at the central repository.
@return int: number of files changed (because of the cascading of folders)
@exception ScriptRepoException : Invalid entry.
*/
virtual void setAutoUpdate(const std::string & path, bool option = true) = 0;
virtual int setAutoUpdate(const std::string & path, bool option = true) = 0;


};
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/src/ExperimentInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ namespace API
* date is selected. If no such files are found the file with the latest from date is
* selected.
*
* If no file is found for the given instrument, an empty string is returned.
*
* @param instrumentName :: Instrument name e.g. GEM, TOPAS or BIOSANS
* @param date :: ISO 8601 date
* @return full path of IDF
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/API/src/FileFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,15 @@ namespace Mantid
* this argument is ignored.
* @return The full path to the file or empty string if not found
*/
std::string FileFinderImpl::findRun(const std::string& hintstr, const std::set<std::string> *exts) const
std::string FileFinderImpl::findRun(const std::string& hintstr, const std::set<std::string> &exts) const
{
std::string hint = Kernel::Strings::strip(hintstr);
g_log.debug() << "set findRun(\'" << hintstr << "\', exts[" << exts->size() << "])\n";
g_log.debug() << "set findRun(\'" << hintstr << "\', exts[" << exts.size() << "])\n";
if (hint.empty())
return "";
std::vector<std::string> exts_v;
if (exts != NULL && exts->size() > 0)
exts_v.assign(exts->begin(), exts->end());
if (!exts.empty())
exts_v.assign(exts.begin(), exts.end());

return this->findRun(hint, exts_v);
}
Expand Down
17 changes: 16 additions & 1 deletion Code/Mantid/Framework/API/src/LogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,22 @@ Kernel::Logger& LogManager::g_log = Kernel::Logger::get("LogManager");
}
}


/** Clears out all but the last entry of all logs of type TimeSeriesProperty
* Check the documentation/definition of TimeSeriesProperty::clearOutdated for
* the definition of 'last entry'.
*/
void LogManager::clearOutdatedTimeSeriesLogValues()
{
auto & props = getProperties();
for ( auto it = props.begin(); it != props.end(); ++it)
{
if ( auto tsp = dynamic_cast<ITimeSeriesProperty*>(*it) )
{
tsp->clearOutdated();
}
}
}

//--------------------------------------------------------------------------------------------
/** Save the object to an open NeXus file.
* @param file :: open NeXus file
Expand Down
12 changes: 7 additions & 5 deletions Code/Mantid/Framework/API/test/ExperimentInfoTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,13 @@ class ExperimentInfoTest : public CxxTest::TestSuite
{
if (it1 != it2)
{
if ( it2->second.from == it1->second.from )
{
// some more intelligent stuff here later
TS_ASSERT_EQUALS("Two IDFs for one instrument have equal valid-from dates", "0");
}
// some more intelligent stuff here later
std::stringstream messageBuffer;
messageBuffer << "Two IDFs for one instrument have equal valid-from dates" <<
"IDFs are: " << it1->first << " and " << it2->first <<
" Date One: "<< it1->second.from.toFormattedString() <<
" Date Two: "<< it2->second.from.toFormattedString();
TSM_ASSERT_DIFFERS(messageBuffer.str(), it2->second.from, it1->second.from);
}
}

Expand Down
30 changes: 30 additions & 0 deletions Code/Mantid/Framework/API/test/LogManagerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,37 @@ class LogManagerTest : public CxxTest::TestSuite
TS_ASSERT_EQUALS( runInfo.getPropertyValueAsType<int>(intProp), 99 );
}

void clearOutdatedTimeSeriesLogValues()
{
// Set up a Run object with 3 properties in it (1 time series, 2 single value)
LogManager runInfo;
const std::string stringProp("aStringProp");
const std::string stringVal("testing");
runInfo.addProperty(stringProp,stringVal);
const std::string intProp("anIntProp");
runInfo.addProperty(intProp,99);
const std::string tspProp("tsp");
addTestTimeSeries(runInfo,"tsp");

// Check it's set up right
TS_ASSERT_EQUALS( runInfo.getProperties().size(), 3 );
auto tsp = runInfo.getTimeSeriesProperty<double>(tspProp);
TS_ASSERT_EQUALS( tsp->realSize(), 10 );

auto lastTime = tsp->lastTime();
auto lastValue = tsp->lastValue();

// Do the clearing work
TS_ASSERT_THROWS_NOTHING( runInfo.clearOutdatedTimeSeriesLogValues() );

// Check the time-series property has 1 entry, & the others are unchanged
TS_ASSERT_EQUALS( runInfo.getProperties().size(), 3 );
TS_ASSERT_EQUALS( tsp->realSize(), 1 );
TS_ASSERT_EQUALS( tsp->firstTime(), lastTime );
TS_ASSERT_EQUALS( tsp->firstValue(), lastValue );
TS_ASSERT_EQUALS( runInfo.getPropertyValueAsType<std::string>(stringProp), stringVal );
TS_ASSERT_EQUALS( runInfo.getPropertyValueAsType<int>(intProp), 99 );
}

/** Save and load to NXS file */
void test_nexus()
Expand Down
3 changes: 0 additions & 3 deletions Code/Mantid/Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ set ( SRC_FILES
src/FindDetectorsOutsideLimits.cpp
src/FindPeaks.cpp
src/FindPeakBackground.cpp
src/FlatBackground.cpp
src/FlatPlateAbsorption.cpp
src/GeneralisedSecondDifference.cpp
src/GenerateEventsFilter.cpp
Expand Down Expand Up @@ -328,7 +327,6 @@ set ( INC_FILES
inc/MantidAlgorithms/FindDetectorsOutsideLimits.h
inc/MantidAlgorithms/FindPeaks.h
inc/MantidAlgorithms/FindPeakBackground.h
inc/MantidAlgorithms/FlatBackground.h
inc/MantidAlgorithms/FlatPlateAbsorption.h
inc/MantidAlgorithms/GSLFunctions.h
inc/MantidAlgorithms/GeneralisedSecondDifference.h
Expand Down Expand Up @@ -556,7 +554,6 @@ set ( TEST_FILES
FindDetectorsOutsideLimitsTest.h
FindPeaksTest.h
FindPeakBackgroundTest.h
FlatBackgroundTest.h
FlatPlateAbsorptionTest.h
GenerateEventsFilterTest.h
GeneratePeaksTest.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ namespace Mantid
* Index into vector: workspace index in the lhs;
* Value at that index: workspace index of the rhs to apply to the WI in the lhs. -1 if not found.
*/
typedef std::vector< int64_t > BinaryOperationTable;
typedef std::vector< int64_t> BinaryOperationTable;
typedef boost::shared_ptr<BinaryOperationTable> BinaryOperationTable_sptr;

static BinaryOperationTable * buildBinaryOperationTable(API::MatrixWorkspace_const_sptr lhs, API::MatrixWorkspace_const_sptr rhs);
static BinaryOperationTable_sptr
buildBinaryOperationTable(const API::MatrixWorkspace_const_sptr & lhs, const API::MatrixWorkspace_const_sptr & rhs);


//protected:
private:
// Overridden Algorithm methods
void init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IPeaksWorkspace.h"
#include "MantidDataObjects/EventWorkspace.h"

namespace Mantid
{
Expand Down Expand Up @@ -38,10 +40,7 @@ namespace Algorithms
<LI> Result - Contains 'success' if the workspaces match, the reason for the failure otherwise </LI>
</UL>
@author Russell Taylor, Tessella Support Services plc
@date 01/12/2009
Copyright &copy; 2009 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Copyright &copy; 2009-2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Expand Down Expand Up @@ -92,11 +91,11 @@ class DLLExport CheckWorkspacesMatch : public API::Algorithm
/// Execution code
void exec();

// property indicate that relative error tolerance in data is set up rather then absolute error.
bool m_ErrorIsRelative;
void doComparison();
// Compare two MD workspaces
void doPeaksComparison(API::IPeaksWorkspace_sptr tws1, API::IPeaksWorkspace_sptr tws2);
void doTableComparison(API::ITableWorkspace_const_sptr tws1, API::ITableWorkspace_const_sptr tws2);
void doMDComparison(API::Workspace_sptr w1, API::Workspace_sptr w2);
bool checkEventLists(DataObjects::EventWorkspace_const_sptr ews1, DataObjects::EventWorkspace_const_sptr ews2);
bool checkData(API::MatrixWorkspace_const_sptr ws1, API::MatrixWorkspace_const_sptr ws2);
bool checkAxes(API::MatrixWorkspace_const_sptr ws1, API::MatrixWorkspace_const_sptr ws2);
bool checkSpectraMap(API::MatrixWorkspace_const_sptr ws1, API::MatrixWorkspace_const_sptr ws2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ namespace Algorithms
virtual int version() const { return 1;};
/// Algorithm's category for identification
virtual const std::string category() const { return "Sample;Utility\\Workspaces;DataHandling";}

/// @inheritdocs
virtual std::map<std::string, std::string> validateInputs();
private:
/// Sets documentation strings for this algorithm
virtual void initDocs();
Expand All @@ -64,9 +65,7 @@ namespace Algorithms
/// Run the algorithm
void exec();
/// Function to copy information from one sample to another
void copyParameters(API::Sample& from,API::Sample& to,bool nameFlag,bool materialFlag, bool environmentFlag, bool shapeFlag,bool latticeFlag);


void copyParameters(API::Sample& from, API::Sample& to, bool nameFlag, bool materialFlag, bool environmentFlag, bool shapeFlag, bool latticeFlag, bool orientationOnlyFlag);

};

Expand Down

0 comments on commit 05a3ff6

Please sign in to comment.