Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
49dd30fa
Unverified
Commit
49dd30fa
authored
Feb 15, 2021
by
Dominik Arominski
Committed by
GitHub
Feb 15, 2021
Browse files
Merge branch 'master' into ILL_loaders_cleanup
parents
bfe574d8
472f13dc
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
.style.yapf
View file @
49dd30fa
[style]
based_on_style = pep8
column_limit = 1
0
0
column_limit = 1
4
0
allow_split_before_dict_value = false
each_dict_entry_on_separate_line = true
CMakeLists.txt
View file @
49dd30fa
...
...
@@ -30,8 +30,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/buildconfig/CMake")
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
PROJECT_BINARY_DIR
}
/bin
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
PROJECT_BINARY_DIR
}
/bin
)
option
(
ENABLE_MANTIDPLOT
"Enable Qt4-based gui & components"
O
N
)
option
(
ENABLE_MANTIDPLOT
"Enable Qt4-based gui & components"
O
FF
)
option
(
ENABLE_WORKBENCH
"Enable Qt5-based gui & components"
ON
)
if
(
ENABLE_MANTIDPLOT
)
message
(
FATAL_ERROR
"MantidPlot has been removed from the source code"
)
endif
()
set
(
CPACK_INSTALL_CMAKE_PROJECTS
"
${
CMAKE_BINARY_DIR
}
"
"Mantid"
"ALL"
"/"
)
...
...
@@ -56,6 +59,13 @@ set_property(CACHE CPACK_PACKAGE_SUFFIX
unstable
""
)
# empty string and release are treated as the same thing
if
(
CPACK_PACKAGE_SUFFIX
)
# Camelcase version of suffix for Windows/Mac
string
(
TOUPPER
${
CPACK_PACKAGE_SUFFIX
}
CPACK_PACKAGE_SUFFIX_CAMELCASE
)
string
(
SUBSTRING
${
CPACK_PACKAGE_SUFFIX_CAMELCASE
}
0 1 CPACK_PACKAGE_SUFFIX_CAMELCASE
)
string
(
SUBSTRING
${
CPACK_PACKAGE_SUFFIX
}
1 -1 _tmp_suffix_remainder
)
string
(
CONCAT CPACK_PACKAGE_SUFFIX_CAMELCASE
${
CPACK_PACKAGE_SUFFIX_CAMELCASE
}
${
_tmp_suffix_remainder
}
)
endif
()
# Set package name here
set
(
CPACK_PACKAGE_NAME
"mantid
${
CPACK_PACKAGE_SUFFIX
}
"
)
...
...
@@ -69,23 +79,8 @@ include(Eigen)
include
(
Span
)
# Set ParaView information since later items depend on it
# VATES flag. Requires ParaView
option
(
MAKE_VATES
"Switch for compiling the Vates project"
)
if
(
ENABLE_MANTIDPLOT AND MAKE_VATES
)
find_package
(
ParaView
)
if
(
ParaView_FOUND
)
add_definitions
(
-DMAKE_VATES
)
# Poco::File throws an exception when a backslash is used.
string
(
REPLACE
"
\\
"
"/"
ParaView_DIR
${
ParaView_DIR
}
)
endif
()
endif
()
if
(
ENABLE_MANTIDPLOT
)
include
(
ParaViewSetup
)
endif
()
option
(
MAKE_VATES
"Switch for compiling the Vates project"
Off
)
if
(
MSVC
)
include
(
MSVCSetup
)
...
...
@@ -115,42 +110,13 @@ if(COVERALLS)
coveralls_turn_on_coverage
()
endif
()
# Qt/Qwt/PyQt/sip
if
(
ENABLE_MANTIDPLOT
)
set
(
QT_USE_IMPORTED_TARGETS ON
)
find_package
(
Qt4
COMPONENTS QtCore
QtDesigner
QtGui
QtOpenGL
QtScript
QtSvg
QtXml
REQUIRED
)
find_package
(
QScintillaQt4 REQUIRED
)
find_package
(
Qwt5 REQUIRED
)
if
(
QWT5_VERSION VERSION_LESS 5.0
OR QWT5_VERSION VERSION_EQUAL 6.0
OR QWT5_VERSION VERSION_GREATER 6.0
)
message
(
FATAL_ERROR
"Qwt version 5 is required, found:
${
QWT5_VERSION
}
"
)
endif
()
if
(
UNIX_DIST MATCHES
"RedHatEnterprise"
AND UNIX_RELEASE MATCHES
"7\..*"
)
set
(
USE_PRIVATE_SIPPYQT4 ON
)
include
(
ExternalSipPyQt4
)
else
()
find_package
(
PyQt4 REQUIRED
)
find_package
(
SIP REQUIRED
)
endif
()
separate_arguments
(
PYQT4_SIP_FLAGS
)
endif
()
if
(
ENABLE_WORKBENCH
)
find_package
(
Qt5
COMPONENTS Core
Gui
Widgets
OpenGL
Test
REQUIRED
)
if
(
Qt5_FOUND
)
message
(
STATUS
"Found Qt
${
Qt5_VERSION
}
:
${
Qt5_DIR
}
"
)
...
...
@@ -187,33 +153,6 @@ include_directories(Framework/NexusGeometry/inc)
set
(
CORE_MANTIDLIBS Kernel HistogramData Indexing Beamline Geometry API Types
)
if
(
ENABLE_MANTIDPLOT AND MAKE_VATES
)
if
(
NOT APPLE
)
list
(
APPEND CPACK_INSTALL_CMAKE_PROJECTS
"
${
ParaView_DIR
}
"
"ParaView Runtime Libs"
"Runtime"
"
${
INBUNDLE
}
/"
)
list
(
APPEND CPACK_INSTALL_CMAKE_PROJECTS
"
${
ParaView_DIR
}
"
"VTK Runtime Libs"
"RuntimeLibraries"
"
${
INBUNDLE
}
/"
)
list
(
APPEND CPACK_INSTALL_CMAKE_PROJECTS
"
${
ParaView_DIR
}
"
"HDF5 Core Library"
"libraries"
"
${
INBUNDLE
}
/"
)
list
(
APPEND CPACK_INSTALL_CMAKE_PROJECTS
"
${
ParaView_DIR
}
"
"HDF5 HL Library"
"hllibraries"
"
${
INBUNDLE
}
/"
)
endif
()
endif
(
ENABLE_MANTIDPLOT AND MAKE_VATES
)
if
(
UNIX
)
# Experimental feature. Unix only at this point.
option
(
UNITY_BUILD
...
...
@@ -227,7 +166,7 @@ endif()
add_custom_target
(
AllTests
)
add_dependencies
(
AllTests FrameworkTests
)
if
(
ENABLE_MANTIDPLOT OR
ENABLE_WORKBENCH
)
if
(
ENABLE_WORKBENCH
)
add_custom_target
(
GUITests
)
add_dependencies
(
check GUITests
)
# Collect all tests together
...
...
@@ -235,10 +174,6 @@ if(ENABLE_MANTIDPLOT OR ENABLE_WORKBENCH)
add_subdirectory
(
qt
)
endif
()
if
(
ENABLE_MANTIDPLOT
)
add_subdirectory
(
MantidPlot
)
endif
()
add_subdirectory
(
scripts
)
# Docs requirements
...
...
@@ -287,11 +222,6 @@ endif()
# Installation settings
if
(
ENABLE_MANTIDPLOT
)
# N.B. INBUNDLE variable is empty except on Mac (set in DarwinSetup.cmake)
install
(
DIRECTORY installers/colormaps/ DESTINATION
${
INBUNDLE
}
colormaps
)
endif
()
# Install the files (.desktop and icon) to create a menu items
if
(
${
CMAKE_SYSTEM_NAME
}
STREQUAL
"Linux"
)
function
(
uppercase_first_letter output_var input
)
...
...
@@ -331,17 +261,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if
(
CPACK_PACKAGE_SUFFIX
)
uppercase_first_letter
(
_app_name_suffix
${
CPACK_PACKAGE_SUFFIX
}
)
endif
()
if
(
ENABLE_MANTIDPLOT
)
set
(
_icon_filename
${
IMAGES_DIR
}
/mantidplot
)
if
(
_icon_suffix
)
set
(
_icon_filename
${
_icon_filename
}${
_icon_suffix
}
)
endif
()
install_desktop_files
(
mantidplot
${
CPACK_PACKAGE_SUFFIX
}
.desktop
"Mantid Plot
${
_app_name_suffix
}
"
${
CMAKE_INSTALL_PREFIX
}
/bin/MantidPlot
${
_icon_filename
}
.png
mantidplot
${
CPACK_PACKAGE_SUFFIX
}
.png
)
endif
()
if
(
ENABLE_WORKBENCH
)
set
(
_icon_filename
${
IMAGES_DIR
}
/mantid_workbench
)
...
...
@@ -394,10 +313,6 @@ if(ENABLE_CPACK)
"OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization,"
"poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,"
"hdf,hdf5,jsoncpp >= 0.7.0"
)
if
(
ENABLE_MANTIDPLOT
)
set
(
CPACK_RPM_PACKAGE_REQUIRES
"
${
CPACK_RPM_PACKAGE_REQUIRES
}
,qt4 >= 4.2,qscintilla,qwt5-qt4,qwtplot3d-qt4"
)
endif
()
if
(
ENABLE_WORKBENCH
)
set
(
CPACK_RPM_PACKAGE_REQUIRES
"
${
CPACK_RPM_PACKAGE_REQUIRES
}
,qt5-qtbase,qscintilla-qt5"
)
...
...
@@ -411,11 +326,6 @@ if(ENABLE_CPACK)
"python36-six,python36-PyYAML,python36-requests,python36-toml,"
"python36-ipython,python36-ipython-notebook"
)
if
(
ENABLE_MANTIDPLOT
)
set
(
CPACK_RPM_PACKAGE_REQUIRES
"
${
CPACK_RPM_PACKAGE_REQUIRES
}
,python36-QtPy,"
"python36-matplotlib-qt4,python36-ipython-gui"
)
endif
()
if
(
ENABLE_WORKBENCH
)
set
(
CPACK_RPM_PACKAGE_REQUIRES
"
${
CPACK_RPM_PACKAGE_REQUIRES
}
,python36-qt5,python36-QtPy,"
...
...
@@ -447,19 +357,6 @@ if(ENABLE_CPACK)
"librdkafka1,librdkafka++1,"
"libpocofoundation
${
POCO_SOLIB_VERSION
}
,libpocoutil
${
POCO_SOLIB_VERSION
}
,libpoconet
${
POCO_SOLIB_VERSION
}
,libpoconetssl
${
POCO_SOLIB_VERSION
}
,libpococrypto
${
POCO_SOLIB_VERSION
}
,libpocoxml
${
POCO_SOLIB_VERSION
}
"
)
if
(
ENABLE_MANTIDPLOT
)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
"
${
CPACK_DEBIAN_PACKAGE_DEPENDS
}
,libqtcore4 (>= 4.2),"
"libqtgui4 (>= 4.2),"
"libqt4-opengl (>= 4.2),"
"libqt4-xml (>= 4.2),"
"libqt4-svg (>= 4.2),"
"libqt4-qt3support (>= 4.2),"
"qt4-dev-tools,"
"libqwt5-qt4,"
"libqwtplot3d-qt4-0v5,"
"libqtwebkit4"
)
endif
()
if
(
"
${
UNIX_CODENAME
}
"
STREQUAL
"bionic"
)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
...
...
@@ -472,7 +369,7 @@ if(ENABLE_CPACK)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
"
${
CPACK_DEBIAN_PACKAGE_DEPENDS
}
,libqscintilla2-qt5-13"
)
endif
()
else
(
)
else
if
(
"
${
UNIX_DIST
}
"
MATCHES
"Ubuntu"
)
message
(
WARNING
"Unsupported Debian-like OS:
${
UNIX_CODENAME
}
. Packaging is unlikely to work correctly."
)
endif
()
# python requirements
...
...
@@ -490,10 +387,6 @@ if(ENABLE_CPACK)
"python3-yaml,"
"ipython3-qtconsole"
)
# transitional package for bionic
if
(
ENABLE_MANTIDPLOT
)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
"
${
CPACK_DEBIAN_PACKAGE_DEPENDS
}
,python3-pyqt4"
)
endif
()
if
(
ENABLE_WORKBENCH
)
set
(
CPACK_DEBIAN_PACKAGE_DEPENDS
"
${
CPACK_DEBIAN_PACKAGE_DEPENDS
}
,python3-pyqt5,python3-psutil"
)
...
...
Framework/API/inc/MantidAPI/CompositeFunction.h
View file @
49dd30fa
...
...
@@ -107,8 +107,12 @@ public:
[[
nodiscard
]]
bool
isExplicitlySet
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter
[[
nodiscard
]]
double
getError
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter by name
[[
nodiscard
]]
double
getError
(
const
std
::
string
&
name
)
const
override
;
/// Set the fitting error for a parameter
void
setError
(
size_t
i
,
double
err
)
override
;
/// Set the fitting error for a parameter by name
void
setError
(
const
std
::
string
&
name
,
double
err
)
override
;
/// Value of i-th active parameter. Override this method to make fitted
/// parameters different from the declared
[[
nodiscard
]]
double
activeParameter
(
size_t
i
)
const
override
;
...
...
Framework/API/inc/MantidAPI/FunctionGenerator.h
View file @
49dd30fa
...
...
@@ -65,8 +65,12 @@ public:
bool
isExplicitlySet
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter
double
getError
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter by name
double
getError
(
const
std
::
string
&
name
)
const
override
;
/// Set the fitting error for a parameter
void
setError
(
size_t
i
,
double
err
)
override
;
/// Set the fitting error for a parameter by name
void
setError
(
const
std
::
string
&
name
,
double
err
)
override
;
/// Return parameter index from a parameter reference.
size_t
getParameterIndex
(
const
ParameterReference
&
ref
)
const
override
;
...
...
Framework/API/inc/MantidAPI/FunctionParameterDecorator.h
View file @
49dd30fa
...
...
@@ -75,8 +75,12 @@ public:
bool
isExplicitlySet
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter of decorated function.
double
getError
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter of decorated function by name.
double
getError
(
const
std
::
string
&
name
)
const
override
;
/// Set the fitting error for a parameter of decorated function.
void
setError
(
size_t
i
,
double
err
)
override
;
/// Set the fitting error for a parameter of decorated function by name.
void
setError
(
const
std
::
string
&
name
,
double
err
)
override
;
/// Return parameter index of decorated function from a parameter reference.
/// Usefull for constraints and ties in composite functions.
...
...
Framework/API/inc/MantidAPI/IFunction.h
View file @
49dd30fa
...
...
@@ -44,6 +44,19 @@ class Workspace;
class
MatrixWorkspace
;
class
FunctionHandler
;
/**
* Attribute visitor structure supporting lambda expressions
* Example usage: AttributeLambdaVisitor{[](const int val) {...}, [] (const
* double val) {}} would create a visitor capable of "visiting" an integer and
* double attribute*
* It functions by inheriting the () operator defined in each lambda
*/
template
<
class
...
Ts
>
struct
AttributeLambdaVisitor
:
Ts
...
{
using
Ts
::
operator
()...;
};
template
<
class
...
Ts
>
AttributeLambdaVisitor
(
Ts
...)
->
AttributeLambdaVisitor
<
Ts
...
>
;
/** This is an interface to a fitting function - a semi-abstarct class.
Functions derived from IFunction can be used with the Fit algorithm.
IFunction defines the structure of a fitting funtion.
...
...
@@ -250,6 +263,10 @@ public:
template
<
typename
T
>
T
apply
(
ConstAttributeVisitor
<
T
>
&
v
)
const
{
return
boost
::
apply_visitor
(
v
,
m_data
);
}
/// Apply a lambda visitor
template
<
typename
...
Ts
>
void
apply
(
AttributeLambdaVisitor
<
Ts
...
>
&
v
)
{
boost
::
apply_visitor
(
v
,
m_data
);
}
/// Returns type of the attribute
std
::
string
type
()
const
;
...
...
@@ -401,8 +418,12 @@ public:
virtual
bool
isExplicitlySet
(
size_t
i
)
const
=
0
;
/// Get the fitting error for a parameter
virtual
double
getError
(
size_t
i
)
const
=
0
;
/// Get the fitting error for a parameter by name
virtual
double
getError
(
const
std
::
string
&
name
)
const
=
0
;
/// Set the fitting error for a parameter
virtual
void
setError
(
size_t
i
,
double
err
)
=
0
;
/// Set the fitting error for a parameter by name
virtual
void
setError
(
const
std
::
string
&
name
,
double
err
)
=
0
;
/// Check if a parameter i is fixed
[[
nodiscard
]]
bool
isFixed
(
size_t
i
)
const
;
...
...
@@ -539,10 +560,10 @@ public:
std
::
shared_ptr
<
const
Kernel
::
Matrix
<
double
>>
getCovarianceMatrix
()
const
{
return
m_covar
;
}
/// Set the chi^2
void
setChiSquared
(
double
chi2
)
{
m_chiSquared
=
chi2
;
}
/// Get the chi^2
[[
nodiscard
]]
double
getChiSquared
()
const
{
return
m_chiSquared
;
}
/// Set the
reduced
chi^2
void
set
Reduced
ChiSquared
(
double
chi2
)
{
m_chiSquared
=
chi2
;
}
/// Get the
reduced
chi^2
[[
nodiscard
]]
double
get
Reduced
ChiSquared
()
const
{
return
m_chiSquared
;
}
/// Set the parallel hint
void
setParallel
(
bool
on
)
{
...
...
Framework/API/inc/MantidAPI/IPeakFunction.h
View file @
49dd30fa
...
...
@@ -61,6 +61,15 @@ public:
/// Get name of parameter that is associated to centre.
std
::
string
getCentreParameterName
()
const
;
/// Get the name of the parameter that is changed when the
/// fwhm is changed. By default this returns an empty string (unless
/// overridden in the individual functions) as some functions change two
/// params when the fwhm is set and others don't have a width (delta
/// func).This is intended for the BackToBackExponential-based peaks where
/// the width parameter (S) can be set in the intsurment parameter file and
/// this needs to be checked when a peak is added.
virtual
std
::
string
getWidthParameterName
()
const
{
return
""
;
}
/// Fix a parameter or set up a tie such that value returned
/// by intensity() is constant during fitting.
/// @param isDefault :: If true fix intensity by default:
...
...
Framework/API/inc/MantidAPI/IndexProperty.h
View file @
49dd30fa
...
...
@@ -36,7 +36,8 @@ public:
Kernel
::
IValidator_sptr
(
new
Kernel
::
NullValidator
));
IndexProperty
(
const
IndexProperty
&
)
=
default
;
IndexProperty
&
operator
=
(
const
IndexProperty
&
)
=
default
;
// Copy assignment is deleted since there are reference type members.
IndexProperty
&
operator
=
(
const
IndexProperty
&
)
=
delete
;
IndexProperty
*
clone
()
const
override
;
...
...
Framework/API/inc/MantidAPI/MatrixWorkspace.h
View file @
49dd30fa
...
...
@@ -121,6 +121,9 @@ public:
bool
hasGroupedDetectors
()
const
;
/// Returns true if the workspace is ragged (has differently sized spectra).
virtual
bool
isRaggedWorkspace
()
const
=
0
;
/// Get the footprint in memory in bytes.
size_t
getMemorySize
()
const
override
;
virtual
size_t
getMemorySizeForXAxes
()
const
;
...
...
@@ -132,6 +135,10 @@ public:
/// This throws an exception if the lengths are not identical across the
/// spectra.
virtual
std
::
size_t
blocksize
()
const
=
0
;
/// Returns the number of bins for a given histogram index.
virtual
std
::
size_t
getNumberBins
(
const
std
::
size_t
&
index
)
const
=
0
;
/// Returns the maximum number of bins in a workspace (works on ragged data).
virtual
std
::
size_t
getMaxNumberBins
()
const
=
0
;
/// Returns the number of histograms in the workspace
virtual
std
::
size_t
getNumberHistograms
()
const
=
0
;
...
...
@@ -144,7 +151,7 @@ public:
Types
::
Core
::
DateAndTime
getLastPulseTime
()
const
;
/// Returns the y index which corresponds to the X Value provided
std
::
size_t
yIndexOfX
(
const
double
xValue
,
const
std
::
size_t
=
0
,
std
::
size_t
yIndexOfX
(
const
double
xValue
,
const
std
::
size_t
&
index
=
0
,
const
double
tolerance
=
0.0
)
const
;
//----------------------------------------------------------------------
...
...
@@ -579,11 +586,10 @@ protected:
private:
std
::
size_t
binIndexOfValue
(
Mantid
::
HistogramData
::
HistogramX
const
&
xValues
,
double
const
&
xValue
,
bool
const
&
ascendingOrder
,
double
const
&
tolerance
)
const
;
std
::
size_t
xIndexOfValue
(
Mantid
::
HistogramData
::
HistogramX
const
&
xValues
,
double
const
&
xValue
,
double
const
&
tolerance
)
const
;
const
double
xValue
,
const
bool
ascendingOrder
)
const
;
std
::
size_t
xIndexOfValue
(
const
Mantid
::
HistogramData
::
HistogramX
&
xValues
,
const
double
xValue
,
const
double
tolerance
)
const
;
MatrixWorkspace
*
doClone
()
const
override
=
0
;
MatrixWorkspace
*
doCloneEmpty
()
const
override
=
0
;
...
...
Framework/API/inc/MantidAPI/ParamFunction.h
View file @
49dd30fa
...
...
@@ -64,8 +64,12 @@ public:
bool
isExplicitlySet
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter
double
getError
(
size_t
i
)
const
override
;
/// Get the fitting error for a parameter by name
double
getError
(
const
std
::
string
&
name
)
const
override
;
/// Set the fitting error for a parameter
void
setError
(
size_t
i
,
double
err
)
override
;
/// Set the fitting error for a parameter by name
void
setError
(
const
std
::
string
&
name
,
double
err
)
override
;
/// Return parameter index from a parameter reference. Usefull for constraints
/// and ties in composite functions
...
...
Framework/API/inc/MantidAPI/PrecompiledHeader.h
View file @
49dd30fa
...
...
@@ -7,33 +7,15 @@
#pragma once
// Mantid
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/IComponent.h"
#include "MantidGeometry/IDetector.h"
#include "MantidGeometry/Instrument.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/IPropertyManager.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/Quat.h"
#include "MantidKernel/System.h"
#include "MantidKernel/V3D.h"
// STL
#include <cfloat>
#include <cmath>
#include <cstddef>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
// Boost
#include <boost/variant.hpp>
#include <memory>
// Poco
#include <Poco/DOM/DOMParser.h>
#include <Poco/XML/XML.h>
Framework/API/inc/MantidAPI/Run.h
View file @
49dd30fa
...
...
@@ -76,19 +76,36 @@ public:
/// Returns the vector of bin boundaries
std
::
vector
<
double
>
getBinBoundaries
()
const
;
/// Set the gonoimeter & read the values from the logs if told to do so
/// Set a single gonoimeter & read the average values from the logs if told to
/// do so
void
setGoniometer
(
const
Geometry
::
Goniometer
&
goniometer
,
const
bool
useLogValues
);
/** @return A reference to the const Goniometer object for this run */
inline
const
Geometry
::
Goniometer
&
getGoniometer
()
const
{
return
*
m_goniometer
;
}
/** @return A reference to the non-const Goniometer object for this run */
inline
Geometry
::
Goniometer
&
mutableGoniometer
()
{
return
*
m_goniometer
;
}
// Retrieve the goniometer rotation matrix
/// Set the gonoimeters using the individual values
void
setGoniometers
(
const
Geometry
::
Goniometer
&
goniometer
);
/// Return reference to the first const Goniometer object for this run
const
Geometry
::
Goniometer
&
getGoniometer
()
const
;
/// Return reference to the first non-const Goniometer object for this run
Geometry
::
Goniometer
&
mutableGoniometer
();
/// Retrieve the first goniometer rotation matrix
const
Kernel
::
Matrix
<
double
>
&
getGoniometerMatrix
()
const
;
/// Return reference to a const Goniometer object for the run
const
Geometry
::
Goniometer
&
getGoniometer
(
const
size_t
index
)
const
;
/// Return reference to a non-const Goniometer object for the run
Geometry
::
Goniometer
&
mutableGoniometer
(
const
size_t
index
);
/// Get the number of goniometers in the Run
size_t
getNumGoniometers
()
const
;
/// Retrieve the a goniometer rotation matrix
const
Kernel
::
Matrix
<
double
>
&
getGoniometerMatrix
(
const
size_t
index
)
const
;
/// Append a goniometer to the run
size_t
addGoniometer
(
const
Geometry
::
Goniometer
&
goniometer
);
/// Clear all goniometers on the Run
void
clearGoniometers
();
/// Get vector of all goniometer matrices in the Run
const
std
::
vector
<
Kernel
::
Matrix
<
double
>>
getGoniometerMatrices
()
const
;
/// Save the run to a NeXus file with a given group name
void
saveNexus
(
::
NeXus
::
File
*
file
,
const
std
::
string
&
group
,
bool
keepOpen
=
false
)
const
override
;
...
...
@@ -97,17 +114,20 @@ public:
bool
keepOpen
=
false
)
override
;
private:
/// Calculate the gonoimeter matrix
void
calculateGoniometerMatrix
();
/// Calculate the average gonoimeter matrix
void
calculateAverageGoniometerMatrix
();
/// Calculate the gonoimeter matrices from logs
void
calculateGoniometerMatrices
(
Geometry
::
Goniometer
goniometer
);
/// Goniometer for this run
std
::
unique_ptr
<
Geometry
::
Goniometer
>
m_goniometer
;
std
::
vector
<
std
::
unique_ptr
<
Geometry
::
Goniometer
>
>
m_goniometer
s
;
/// A set of histograms that can be stored here for future reference
std
::
vector
<
double
>
m_histoBins
;
/// Adds all the time series in from one property manager into another
void
mergeMergables
(
Mantid
::
Kernel
::
PropertyManager
&
sum
,
const
Mantid
::
Kernel
::
PropertyManager
&
toAdd
);
void
copyGoniometers
(
const
Run
&
other
);
};
}
// namespace API
}
// namespace Mantid
Framework/API/inc/MantidAPI/WorkspaceHistory.h
View file @
49dd30fa
...
...
@@ -40,8 +40,9 @@ public:
virtual
~
WorkspaceHistory
()
=
default
;
/// Copy constructor
WorkspaceHistory
(
const
WorkspaceHistory
&
)
=
default
;
/// Deleted copy assignment operator
WorkspaceHistory
&
operator
=
(
const
WorkspaceHistory
&
)
=
default
;
/// Deleted copy assignment operator since m_environment has no copy
/// assignment.
WorkspaceHistory
&
operator
=
(
const
WorkspaceHistory
&
)
=
delete
;
/// Retrieve the algorithm history list
const
AlgorithmHistories
&
getAlgorithmHistories
()
const
;
/// Retrieve the environment history
...
...
Framework/API/src/Algorithm.cpp
View file @
49dd30fa
...
...
@@ -639,9 +639,15 @@ bool Algorithm::executeInternal() {
}
// Throw because something was invalid
if
(
numErrors
>
0
)
{
std
::
stringstream
msg
;
msg
<<
"Some invalid Properties found: [ "
;
for
(
auto
&
error
:
errors
)
{
msg
<<
error
.
first
<<
" "
;
}
msg
<<
"]"
;
notificationCenter
().
postNotification
(
new
ErrorNotification
(
this
,
"Some invalid Properties found"
));
throw
std
::
runtime_error
(
"Some invalid Properties found"
);
throw
std
::
runtime_error
(
msg
.
str
()
);
}
}
}
...
...
Framework/API/src/CompositeFunction.cpp
View file @
49dd30fa
...
...
@@ -278,7 +278,9 @@ bool CompositeFunction::hasAttribute(const std::string &name) const {
return
true
;
}
const
auto
[
attributeName
,
index
]
=
parseName
(
name
);
return
m_functions
[
index
]
->
hasAttribute
(
attributeName
);
return
index
<
m_functions
.
size
()
?
m_functions
[
index
]
->
hasAttribute
(
attributeName
)
:
false
;
}
catch
(
std
::
invalid_argument
&
)
{
return
false
;
}
...
...
@@ -422,6 +424,16 @@ double CompositeFunction::getError(size_t i) const {
return
m_functions
[
iFun
]
->
getError
(
i
-
m_paramOffsets
[
iFun
]);
}
/**
* Get the fitting error for a parameter by name.
* @param name :: The name of the parameter.
* @return value of the requested named parameter
*/
double
CompositeFunction
::
getError
(
const
std
::
string
&
name
)
const
{
const
auto
[
parameterName
,
index
]
=
parseName
(
name
);
return
getFunction
(
index
)
->
getError
(
parameterName
);
}
/**
* Set the fitting error for a parameter
* @param i :: The index of a parameter
...
...
@@ -432,6 +444,16 @@ void CompositeFunction::setError(size_t i, double err) {
m_functions
[
iFun
]
->
setError
(
i
-
m_paramOffsets
[
iFun
],
err
);
}
/**
* Sets the fitting error to a parameter by name.
* @param name :: The name of the parameter.
* @param err :: The error value to set
*/
void
CompositeFunction
::
setError
(
const
std
::
string
&
name
,
double
err
)
{
auto
[
parameterName
,
index
]
=
parseName
(
name
);
getFunction
(
index
)
->
setError
(
parameterName
,
err
);
}
/// Value of i-th active parameter. Override this method to make fitted
/// parameters different from the declared
double
CompositeFunction
::
activeParameter
(
size_t
i
)
const
{
...
...
Framework/API/src/FunctionGenerator.cpp
View file @
49dd30fa
...
...
@@ -151,6 +151,12 @@ double FunctionGenerator::getError(size_t i) const {
}
}
/// Get the fitting error for a parameter by name