Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 11131_peak_centre_h…
Browse files Browse the repository at this point in the history
…eight_width

Conflicts:
	Code/Mantid/Framework/CurveFitting/CMakeLists.txt
Re #11131.
  • Loading branch information
mantid-roman committed Mar 5, 2015
2 parents db66da5 + d96cc82 commit 9cc6163
Show file tree
Hide file tree
Showing 1,051 changed files with 42,811 additions and 7,977 deletions.
7 changes: 2 additions & 5 deletions Code/Mantid/Build/Jenkins/buildscript
Expand Up @@ -10,6 +10,8 @@
# slave.
###############################################################################
SCRIPT_DIR=$(dirname "$0")
# Package by default
BUILDPKG=true

###############################################################################
# Print out the versions of things we are using
Expand Down Expand Up @@ -88,7 +90,6 @@ fi
###############################################################################
if [[ ${JOB_NAME} == *clean* ]]; then
CLEANBUILD=true
BUILDPKG=true
fi

if [[ -e $WORKSPACE/build/CMakeCache.txt ]]; then
Expand All @@ -99,10 +100,6 @@ if [[ -e $WORKSPACE/build/CMakeCache.txt ]]; then
fi
fi

if [[ ${JOB_NAME} == *pull_requests* ]]; then
BUILDPKG=true
fi

###############################################################################
# Packaging options
###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Build/Jenkins/systemtests.bat
@@ -1,4 +1,4 @@
setlocal enbaleextensions enabledelayedexpansion
setlocal enableextensions enabledelayedexpansion
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: WINDOWS SCRIPT TO DRIVE THE SYSTEM TESTS OF MANTID
::
Expand Down Expand Up @@ -46,8 +46,8 @@ if not EXIST %WORKSPACE%\build\CMakeCache.txt (
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build step
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"%CMAKE_BIN_DIR%\cmake" --build . -- StandardTestData
"%CMAKE_BIN_DIR%\cmake" --build . -- SystemTestData
msbuild /nologo /nr:false /p:Configuration=Release StandardTestData.vcxproj
msbuild /nologo /nr:false /p:Configuration=Release SystemTestData.vcxproj

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Run the tests
Expand Down
18 changes: 18 additions & 0 deletions Code/Mantid/Build/coverity_model.c
@@ -0,0 +1,18 @@
/* Coverity Scan model
*
* This is a modeling file for Coverity Scan. Modeling helps to avoid false
* positives.
*
* - A model file can't import any header files.
* - Therefore only some built-in primitives like int, char and void are
* available but not wchar_t, NULL etc.
* - Modeling doesn't need full structs and typedefs. Rudimentary structs
* and similar types are sufficient.
* - An uninitialized local pointer is not an error. It signifies that the
* variable could be either NULL or have some data.
*
* Coverity Scan doesn't pick up modifications automatically. The model file
* must be uploaded by an admin in the analysis settings of
* http://scan.coverity.com/projects/2832
*/

12 changes: 9 additions & 3 deletions Code/Mantid/Framework/API/CMakeLists.txt
Expand Up @@ -31,6 +31,7 @@ set ( SRC_FILES
src/ExperimentInfo.cpp
src/Expression.cpp
src/FermiChopperModel.cpp
src/FileBackedExperimentInfo.cpp
src/FileFinder.cpp
src/FileLoaderRegistry.cpp
src/FileProperty.cpp
Expand All @@ -39,6 +40,7 @@ set ( SRC_FILES
src/FunctionDomain1D.cpp
src/FunctionDomainMD.cpp
src/FunctionFactory.cpp
src/FunctionParameterDecorator.cpp
src/FunctionProperty.cpp
src/FunctionValues.cpp
src/GridDomain.cpp
Expand Down Expand Up @@ -93,7 +95,7 @@ set ( SRC_FILES
src/ParamFunction.cpp
src/ParameterReference.cpp
src/ParameterTie.cpp
src/PeakFunctionIntegrator.cpp
src/PeakFunctionIntegrator.cpp
src/PeakTransform.cpp
src/PeakTransformHKL.cpp
src/PeakTransformQLab.cpp
Expand Down Expand Up @@ -171,6 +173,7 @@ set ( INC_FILES
inc/MantidAPI/ExperimentInfo.h
inc/MantidAPI/Expression.h
inc/MantidAPI/FermiChopperModel.h
inc/MantidAPI/FileBackedExperimentInfo.h
inc/MantidAPI/FileFinder.h
inc/MantidAPI/FileLoaderRegistry.h
inc/MantidAPI/FileProperty.h
Expand All @@ -180,6 +183,7 @@ set ( INC_FILES
inc/MantidAPI/FunctionDomain1D.h
inc/MantidAPI/FunctionDomainMD.h
inc/MantidAPI/FunctionFactory.h
inc/MantidAPI/FunctionParameterDecorator.h
inc/MantidAPI/FunctionProperty.h
inc/MantidAPI/FunctionValues.h
inc/MantidAPI/GridDomain.h
Expand Down Expand Up @@ -253,7 +257,7 @@ set ( INC_FILES
inc/MantidAPI/ParamFunction.h
inc/MantidAPI/ParameterReference.h
inc/MantidAPI/ParameterTie.h
inc/MantidAPI/PeakFunctionIntegrator.h
inc/MantidAPI/PeakFunctionIntegrator.h
inc/MantidAPI/PeakTransform.h
inc/MantidAPI/PeakTransformFactory.h
inc/MantidAPI/PeakTransformHKL.h
Expand Down Expand Up @@ -311,12 +315,14 @@ set ( TEST_FILES
ExperimentInfoTest.h
ExpressionTest.h
FermiChopperModelTest.h
FileBackedExperimentInfoTest.h
FileFinderTest.h
FilePropertyTest.h
FrameworkManagerTest.h
FuncMinimizerFactoryTest.h
FunctionAttributeTest.h
FunctionDomainTest.h
FunctionParameterDecoratorTest.h
FunctionFactoryTest.h
FunctionPropertyTest.h
FunctionTest.h
Expand Down Expand Up @@ -350,7 +356,7 @@ set ( TEST_FILES
ParamFunctionAttributeHolderTest.h
ParameterReferenceTest.h
ParameterTieTest.h
PeakFunctionIntegratorTest.h
PeakFunctionIntegratorTest.h
PeakTransformHKLTest.h
PeakTransformQLabTest.h
PeakTransformQSampleTest.h
Expand Down
70 changes: 34 additions & 36 deletions Code/Mantid/Framework/API/inc/MantidAPI/ExperimentInfo.h
Expand Up @@ -34,8 +34,6 @@ class ModeratorModel;
* - Run object (sample logs)
* - Sample object (sample info)
*
* @author Janik Zikovsky
* @date 2011-06-20
*/
class MANTID_API_DLL ExperimentInfo {
public:
Expand All @@ -48,94 +46,94 @@ class MANTID_API_DLL ExperimentInfo {
/// Copy everything from the given experiment object
void copyExperimentInfoFrom(const ExperimentInfo *other);
/// Clone us
ExperimentInfo *cloneExperimentInfo() const;
virtual ExperimentInfo *cloneExperimentInfo() const;

/// Returns a string description of the object
const std::string toString() const;
virtual const std::string toString() const;

/// Instrument accessors
void setInstrument(const Geometry::Instrument_const_sptr &instr);
/// Returns the parameterized instrument
Geometry::Instrument_const_sptr getInstrument() const;
virtual Geometry::Instrument_const_sptr getInstrument() const;

/// Returns the set of parameters modifying the base instrument
/// (const-version)
const Geometry::ParameterMap &instrumentParameters() const;
virtual const Geometry::ParameterMap &instrumentParameters() const;
/// Returns a modifiable set of instrument parameters
Geometry::ParameterMap &instrumentParameters();
virtual Geometry::ParameterMap &instrumentParameters();
/// Const version
const Geometry::ParameterMap &constInstrumentParameters() const;
virtual const Geometry::ParameterMap &constInstrumentParameters() const;
// Add parameters to the instrument parameter map
virtual void populateInstrumentParameters();

/// Replaces current parameter map with copy of given map
void replaceInstrumentParameters(const Geometry::ParameterMap &pmap);
virtual void replaceInstrumentParameters(const Geometry::ParameterMap &pmap);
/// exchange contents of current parameter map with contents of other map)
void swapInstrumentParameters(Geometry::ParameterMap &pmap);
virtual void swapInstrumentParameters(Geometry::ParameterMap &pmap);

/// Cache a lookup of grouped detIDs to member IDs
void cacheDetectorGroupings(const det2group_map &mapping);
virtual void cacheDetectorGroupings(const det2group_map &mapping);
/// Returns the detector IDs that make up the group that this ID is part of
const std::vector<detid_t> &getGroupMembers(const detid_t detID) const;
virtual const std::vector<detid_t> &getGroupMembers(const detid_t detID) const;
/// Get a detector or detector group from an ID
Geometry::IDetector_const_sptr getDetectorByID(const detid_t detID) const;
virtual Geometry::IDetector_const_sptr getDetectorByID(const detid_t detID) const;

/// Set an object describing the source properties and take ownership
void setModeratorModel(ModeratorModel *source);
virtual void setModeratorModel(ModeratorModel *source);
/// Returns a reference to the source properties object
ModeratorModel &moderatorModel() const;
virtual ModeratorModel &moderatorModel() const;

/// Set a chopper description specified by index where 0 is closest to the
/// source
void setChopperModel(ChopperModel *chopper, const size_t index = 0);
virtual void setChopperModel(ChopperModel *chopper, const size_t index = 0);
/// Returns a reference to a chopper description
ChopperModel &chopperModel(const size_t index = 0) const;
virtual ChopperModel &chopperModel(const size_t index = 0) const;

/// Sample accessors
const Sample &sample() const;
virtual const Sample &sample() const;
/// Writable version of the sample object
Sample &mutableSample();
virtual Sample &mutableSample();

/// Run details object access
const Run &run() const;
virtual const Run &run() const;
/// Writable version of the run object
Run &mutableRun();
virtual Run &mutableRun();
/// Access a log for this experiment.
Kernel::Property *getLog(const std::string &log) const;
virtual Kernel::Property *getLog(const std::string &log) const;
/// Access a single value from a log for this experiment.
double getLogAsSingleValue(const std::string &log) const;
virtual double getLogAsSingleValue(const std::string &log) const;

/// Utility method to get the run number
int getRunNumber() const;
virtual int getRunNumber() const;
/// Returns the emode for this run
Kernel::DeltaEMode::Type getEMode() const;
virtual Kernel::DeltaEMode::Type getEMode() const;
/// Easy access to the efixed value for this run & detector ID
double getEFixed(const detid_t detID) const;
virtual double getEFixed(const detid_t detID) const;
/// Easy access to the efixed value for this run & optional detector
double getEFixed(const Geometry::IDetector_const_sptr detector =
virtual double getEFixed(const Geometry::IDetector_const_sptr detector =
Geometry::IDetector_const_sptr()) const;
/// Set the efixed value for a given detector ID
void setEFixed(const detid_t detID, const double value);
virtual void setEFixed(const detid_t detID, const double value);

/// Saves this experiment description to the open NeXus file
void saveExperimentInfoNexus(::NeXus::File *file) const;
virtual void saveExperimentInfoNexus(::NeXus::File *file) const;
/// Loads an experiment description from the open NeXus file
void loadExperimentInfoNexus(::NeXus::File *file, std::string &parameterStr);
virtual void loadExperimentInfoNexus(::NeXus::File *file, std::string &parameterStr);
/// Load the instrument from an open NeXus file.
void loadInstrumentInfoNexus(::NeXus::File *file, std::string &parameterStr);
virtual void loadInstrumentInfoNexus(::NeXus::File *file, std::string &parameterStr);
/// Load the sample and log info from an open NeXus file.
void loadSampleAndLogInfoNexus(::NeXus::File *file);
virtual void loadSampleAndLogInfoNexus(::NeXus::File *file);
/// Populate the parameter map given a string
void readParameterMap(const std::string &parameterStr);
virtual void readParameterMap(const std::string &parameterStr);

/// Returns the start date for this experiment (or current time if no info
/// available)
std::string getWorkspaceStartDate() const;
virtual std::string getWorkspaceStartDate() const;

// run/experiment stat time if available, empty otherwise
std::string getAvailableWorkspaceStartDate() const;
virtual std::string getAvailableWorkspaceStartDate() const;
// run end time if available, empty otherwise
std::string getAvailableWorkspaceEndDate() const;
virtual std::string getAvailableWorkspaceEndDate() const;

/// Utility to retrieve the validity dates for the given IDF
static void getValidFromTo(const std::string &IDFfilename,
Expand Down
109 changes: 109 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/FileBackedExperimentInfo.h
@@ -0,0 +1,109 @@
#ifndef MANTID_API_FILEBACKEDEXPERIMENTINFO_H_
#define MANTID_API_FILEBACKEDEXPERIMENTINFO_H_
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/ExperimentInfo.h"

namespace Mantid {
namespace API {

/**
Implements a lazy-loading mechanism for the experimental information
stored in a NeXus file.
Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL FileBackedExperimentInfo : public ExperimentInfo {
public:
/// Constructor
FileBackedExperimentInfo(const std::string & filename, const std::string &path);

ExperimentInfo *cloneExperimentInfo() const;

const std::string toString() const;

Geometry::Instrument_const_sptr getInstrument() const;

const Geometry::ParameterMap &instrumentParameters() const;

Geometry::ParameterMap &instrumentParameters();

const Geometry::ParameterMap &constInstrumentParameters() const;

void populateInstrumentParameters();

void replaceInstrumentParameters(const Geometry::ParameterMap &pmap);

void swapInstrumentParameters(Geometry::ParameterMap &pmap);

void cacheDetectorGroupings(const det2group_map &mapping);

const std::vector<detid_t> &getGroupMembers(const detid_t detID) const;

Geometry::IDetector_const_sptr getDetectorByID(const detid_t detID) const;

void setModeratorModel(ModeratorModel *source);

ModeratorModel &moderatorModel() const;

void setChopperModel(ChopperModel *chopper, const size_t index = 0);

ChopperModel &chopperModel(const size_t index = 0) const;

const Sample &sample() const;

Sample &mutableSample();

const Run &run() const;

Run &mutableRun();

Kernel::Property *getLog(const std::string &log) const;

double getLogAsSingleValue(const std::string &log) const;

int getRunNumber() const;

Kernel::DeltaEMode::Type getEMode() const;

double getEFixed(const detid_t detID) const;

double getEFixed(const Geometry::IDetector_const_sptr detector =
Geometry::IDetector_const_sptr()) const;

void setEFixed(const detid_t detID, const double value);

private:
void populateIfNotLoaded() const;
void populateFromFile() const;

mutable bool m_loaded;
std::string m_filename;
std::string m_nxpath;
};

} // namespace API
} // namespace Mantid

#endif /* MANTID_API_FILEBACKEDEXPERIMENTINFO_H_ */

0 comments on commit 9cc6163

Please sign in to comment.