Commit d25a92dd authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Merge master

parents 99a7b1c5 207ca8a4
......@@ -98,9 +98,12 @@ build/
*.vspscc
.builds
*.egg-info/
qt/python/mantidqt/utils/qt/plugins.py
Framework/Kernel/inc/MantidKernel/GitHubApiHelper.h
Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h
qt/python/mantidqt/resources.py
qt/applications/workbench/workbench/app/resources.py
qt/applications/workbench/setup.py
qt/python/setup.py
# Visual C++ cache files
ipch/
......@@ -178,12 +181,6 @@ XDG_CACHE_HOME/
.tags
.tags_sorted_by_file
# Dynamically created files
Framework/Kernel/inc/MantidKernel/GitHubApiHelper.h
Vates/VatesSimpleGui/ViewWidgets/inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h
qt/applications/workbench/setup.py
qt/python/setup.py
# Make sure Third_Party doesn't get checked into the main repository
Third_Party/
# Common out-of-source build directory names. Usually, these should go in your .git/info/exclude
......
# CMake version check. Require CMake 3.13 - Required for add_link_options
# 3.15 is required on Windows, but is not available to RHEL yet
cmake_minimum_required(VERSION 3.13)
# CMake version check. 3.14 mimimum available from EPEL.
# 3.15 is required on Windows, but is not available in EPEL yet.
cmake_minimum_required(VERSION 3.14)
# Define the project name.
project(Mantid)
......@@ -120,12 +120,14 @@ if(ENABLE_MANTIDPLOT)
set(QT_USE_IMPORTED_TARGETS ON)
find_package(Qt4
COMPONENTS QtCore
QtDesigner
QtGui
QtOpenGL
QtXml
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
......@@ -133,8 +135,7 @@ if(ENABLE_MANTIDPLOT)
message(FATAL_ERROR "Qwt version 5 is required, found: ${QWT5_VERSION}")
endif()
if(PYTHON_VERSION_MAJOR EQUAL 3 AND
UNIX_DIST MATCHES "RedHatEnterprise" AND UNIX_RELEASE MATCHES "7\..*")
if(UNIX_DIST MATCHES "RedHatEnterprise" AND UNIX_RELEASE MATCHES "7\..*")
set(USE_PRIVATE_SIPPYQT4 ON)
include(ExternalSipPyQt4)
else()
......@@ -154,6 +155,7 @@ if(ENABLE_WORKBENCH)
if(Qt5_FOUND)
message(STATUS "Found Qt ${Qt5_VERSION}: ${Qt5_DIR}")
endif()
find_package(QScintillaQt5 REQUIRED)
find_package(PyQt5 REQUIRED)
find_package(SIP REQUIRED)
separate_arguments(PYQT5_SIP_FLAGS)
......@@ -245,7 +247,7 @@ if (ENABLE_DOCS)
find_package(Sphinx 1.2)
if(SPHINX_FOUND)
# run python to see if the theme is installed
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
execute_process(COMMAND ${Python_EXECUTABLE} -c
"import sphinx_bootstrap_theme"
OUTPUT_VARIABLE SPHINX_BOOTSTRAP_THEME_OUT
ERROR_VARIABLE SPHINX_BOOTSTRAP_THEME_ERR
......@@ -253,7 +255,7 @@ if (ENABLE_DOCS)
ERROR_STRIP_TRAILING_WHITESPACE)
if(SPHINX_BOOTSTRAP_THEME_ERR)
message(ERROR " Did not find sphinx_bootstrap_theme")
message(STATUS "${PYTHON_EXECUTABLE} -c \"import sphinx_bootstrap_theme\"")
message(STATUS "${Python_EXECUTABLE} -c \"import sphinx_bootstrap_theme\"")
message(STATUS "${SPHINX_BOOTSTRAP_THEME_ERR}")
message(
FATAL_ERROR
......@@ -402,45 +404,24 @@ if(ENABLE_CPACK)
set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},qt5-qtbase,qscintilla-qt5")
endif()
if(PYTHON_VERSION_MAJOR EQUAL 3)
set(
CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},"
"boost169-python3,"
"python36-numpy,python36-scipy,python36-h5py,python36-PyCifRW,"
"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,"
"python36-matplotlib-qt5,python36-psutil,python36-ipython-gui")
endif()
else()
set(
CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},"
"boost169-python2,"
"numpy,scipy,h5py >= 2.3.1,PyCifRW >= 4.2.1,"
"python-enum34,python-six,PyYAML,python-requests,"
"python-ipython >= 1.1.0,python-ipython-notebook"
)
if(ENABLE_MANTIDPLOT)
set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},sip >= 4.18,PyQt4,python2-QtPy,"
"python2-matplotlib-qt4 >= 1.5.2,python-ipython-gui")
endif()
if(ENABLE_WORKBENCH)
set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},python2-qt5,python2-QtPy,"
"python2-matplotlib-qt4 >= 1.5.2,python-psutil,python-ipython-gui")
endif()
# python requirements
set(
CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},"
"boost169-python3,"
"python36-numpy,python36-scipy,python36-h5py,python36-PyCifRW,"
"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,"
"python36-matplotlib-qt5,python36-psutil,python36-ipython-gui")
endif()
string(REPLACE ";"
......@@ -482,18 +463,7 @@ if(ENABLE_CPACK)
"libqtwebkit4")
endif()
if("${UNIX_CODENAME}" STREQUAL "xenial")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libgsl2,"
"liboce-foundation10,liboce-modeling10,"
"libqscintilla2-12v5,"
"ipython-notebook,"
"libhdf5-cpp-11")
if(ENABLE_WORKBENCH)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt5scintilla2-12v5")
endif()
else() # bionic and newer
if("${UNIX_CODENAME}" STREQUAL "bionic")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libgsl23,"
"liboce-foundation11,liboce-modeling11,"
......@@ -504,54 +474,33 @@ if(ENABLE_CPACK)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libqscintilla2-qt5-13")
endif()
else()
message(WARNING "Unsupported Debian-like OS: ${UNIX_CODENAME}. Packaging is unlikely to work correctly.")
endif()
# python requirements
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-h5py,"
"python3-numpy,"
"python3-requests,"
"python3-sip,"
"python3-six,"
"python3-matplotlib,"
"python3-qtpy,"
"python3-scipy,"
"python3-toml,"
"python3-pycifrw (>= 4.2.1),"
"python3-yaml,"
"ipython3-qtconsole") # transitional package for bionic
if(PYTHON_VERSION_MAJOR EQUAL 3)
if(ENABLE_MANTIDPLOT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-h5py,"
"python3-numpy,"
"python3-requests,"
"python3-sip,"
"python3-six,"
"python3-matplotlib,"
"python3-qtpy,"
"python3-scipy,"
"python3-toml,"
"python3-pycifrw (>= 4.2.1),"
"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")
endif()
else() # python 2
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-pyqt4")
endif()
if(ENABLE_WORKBENCH)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python-h5py,"
"python-numpy,"
"python-requests,"
"python-sip,"
"python-six,"
"python-matplotlib,"
"python-qtpy,"
"python-scipy,"
"python-pycifrw (>= 4.2.1),"
"python-yaml,"
"ipython-qtconsole")
if(ENABLE_MANTIDPLOT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python-qt4")
endif()
if(ENABLE_WORKBENCH)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python-pyqt5,python-psutil")
endif()
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-pyqt5,python3-psutil")
endif()
# parse list to string required for deb package
string(REPLACE ";"
","
......
......@@ -15,6 +15,7 @@ set(SRC_FILES
src/BinEdgeAxis.cpp
src/BoostOptionalToAlgorithmProperty.cpp
src/BoxController.cpp
src/BoxControllerSettingsAlgorithm.cpp
src/CatalogManager.cpp
src/CatalogSession.cpp
src/Citation.cpp
......@@ -67,6 +68,7 @@ set(SRC_FILES
src/IFunctionGeneral.cpp
src/IFunctionMD.cpp
src/IFunctionMW.cpp
src/IJournal.cpp
src/ILatticeFunction.cpp
src/IMDEventWorkspace.cpp
src/IMDHistoWorkspace.cpp
......@@ -179,6 +181,7 @@ set(INC_FILES
inc/MantidAPI/BinEdgeAxis.h
inc/MantidAPI/BoostOptionalToAlgorithmProperty.h
inc/MantidAPI/BoxController.h
inc/MantidAPI/BoxControllerSettingsAlgorithm.h
inc/MantidAPI/CatalogFactory.h
inc/MantidAPI/CatalogManager.h
inc/MantidAPI/CatalogSession.h
......@@ -385,6 +388,7 @@ set(TEST_FILES
AsynchronousTest.h
BinEdgeAxisTest.h
BoxControllerTest.h
BoxControllerSettingsAlgorithmTest.h
CitationTest.h
CommonBinsValidatorTest.h
CompositeFunctionTest.h
......
......@@ -38,7 +38,9 @@ public:
void stopObservingManager();
virtual void progressHandle(const IAlgorithm *alg, double p,
const std::string &msg);
const std::string &msg,
const double estimatedTime,
const int progressPrecision);
virtual void startingHandle(IAlgorithm_sptr alg);
virtual void startHandle(const IAlgorithm *alg);
virtual void finishHandle(const IAlgorithm *alg);
......
......@@ -10,6 +10,8 @@
#include "MantidKernel/NullValidator.h"
#include "MantidKernel/PropertyWithValue.h"
#include <memory>
namespace Mantid {
namespace API {
//-------------------------------------------------------------------------
......@@ -44,6 +46,8 @@ public:
Kernel::IValidator_sptr validator =
Kernel::IValidator_sptr(new Kernel::NullValidator),
unsigned int direction = Kernel::Direction::Input);
AlgorithmProperty(const AlgorithmProperty &) = default;
// Unhide base class member that would be hidden by implicitly declared
// assignment operator
using Kernel::PropertyWithValue<HeldType>::operator=;
......
......@@ -90,11 +90,9 @@ public:
protected:
Axis(const Axis &) = default;
Axis &operator=(const Axis &) = default;
private:
/// Private, undefined copy assignment operator
const Axis &operator=(const Axis &) = delete;
/// The user-defined title for this axis
std::string m_title;
/// The unit for this axis
......
......@@ -29,10 +29,6 @@ public:
std::vector<double> createBinBoundaries() const override;
void setValue(const std::size_t &index, const double &value) override;
size_t indexOfValue(const double value) const override;
private:
/// Private, undefined copy assignment operator
const BinEdgeAxis &operator=(const BinEdgeAxis &);
};
} // namespace API
......
......@@ -12,7 +12,7 @@
#include "MantidKernel/System.h"
namespace Mantid {
namespace MDAlgorithms {
namespace API {
/** An abstract algorithm sub-class for algorithms that
* define properties for BoxController settings.
......@@ -47,5 +47,5 @@ protected:
private:
};
} // namespace MDAlgorithms
} // namespace API
} // namespace Mantid
......@@ -13,6 +13,7 @@
#endif
#include <map>
#include <stdexcept>
#include <string>
#include <unordered_set>
#include <vector>
......
......@@ -73,6 +73,9 @@ public:
unsigned int action, std::initializer_list<std::string> exts,
unsigned int direction = Kernel::Direction::Input);
FileProperty(const FileProperty &) = default;
FileProperty &operator=(const FileProperty &) = default;
/// 'Virtual copy constructor
FileProperty *clone() const override { return new FileProperty(*this); }
......@@ -117,9 +120,6 @@ private:
std::string m_oldLoadPropValue;
/// Last value of foundFile used in FileProperty::setLoadProperty
std::string m_oldLoadFoundFile;
/// Private, unimplemented copy assignment operator
FileProperty &operator=(const FileProperty &right);
};
#ifdef _WIN32
......
......@@ -57,7 +57,7 @@ public:
/// domain has the same function.
std::shared_ptr<MultiDomainFunction>
createInitializedMultiDomainFunction(const std::string &input,
size_t domainNumber);
size_t domainNumber) const;
/// Query available functions based on the template type
template <typename FunctionType>
......
......@@ -241,8 +241,6 @@ public:
/// Create vector attribute
explicit Attribute(const std::vector<double> &v)
: m_data(v), m_quoteValue(false) {}
/// Copy assignment
Attribute &operator=(const Attribute &attr);
/// Apply an attribute visitor
template <typename T> T apply(AttributeVisitor<T> &v) {
......@@ -287,6 +285,11 @@ public:
void setBool(const bool &);
/// Sets new value if attribute is a vector
void setVector(const std::vector<double> &);
template <typename T>
// Set value
void setValue(const T &v) {
m_data = v;
}
/// Set value from a string.
void fromString(const std::string &str);
......@@ -295,7 +298,7 @@ public:
mutable boost::variant<std::string, int, double, bool, std::vector<double>>
m_data;
/// Flag indicating if the string value should be returned quoted
bool m_quoteValue;
bool m_quoteValue = false;
};
//---------------------------------------------------------//
......@@ -501,7 +504,11 @@ public:
/// Set an attribute value
template <typename T>
void setAttributeValue(const std::string &attName, const T &value) {
setAttribute(attName, Attribute(value));
// Since we can't know T and we would rather not create a universal setter
// copy and replace in-place
auto attr = getAttribute(attName);
attr.setValue(value);
setAttribute(attName, attr);
}
void setAttributeValue(const std::string &attName, const char *value);
void setAttributeValue(const std::string &attName, const std::string &value);
......
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/DllConfig.h"
#include <map>
#include <string>
#include <vector>
namespace Mantid {
namespace API {
/**
* IJournal: Interface for classes that fetch information from journal files
*/
class MANTID_API_DLL IJournal {
public:
using RunData = std::map<std::string, std::string>;
IJournal() = default;
virtual ~IJournal();
IJournal(IJournal const &rhs) = delete;
IJournal(IJournal &&rhs);
IJournal const &operator=(IJournal const &rhs) = delete;
IJournal &operator=(IJournal &&rhs);
/// Get the list of cycle names
virtual std::vector<std::string> getCycleNames() = 0;
/// Get data for runs that match the given filters
virtual std::vector<RunData>
getRuns(std::vector<std::string> const &valuesToLookup = {},
RunData const &filters = RunData()) = 0;
};
} // namespace API
} // namespace Mantid
......@@ -35,6 +35,9 @@ public:
const Kernel::IValidator_sptr &validator =
Kernel::IValidator_sptr(new Kernel::NullValidator));
IndexProperty(const IndexProperty &) = default;
IndexProperty &operator=(const IndexProperty &) = default;
IndexProperty *clone() const override;
using Kernel::ArrayProperty<int64_t>::operator=;
......
......@@ -42,6 +42,10 @@ namespace API {
*/
class MANTID_API_DLL LogManager {
public:
// Gets the correct log name for the matching invalid values log for a given
// log name
static std::string getInvalidValuesFilterLogName(const std::string &logName);
LogManager();
LogManager(const LogManager &other);
/// Destructor. Doesn't need to be virtual as long as nothing inherits from
......@@ -184,6 +188,14 @@ public:
/// Clear the logs
void clearLogs();
// returns true if the log has a matching invalid values log filter
bool hasInvalidValuesFilter(const std::string &logName) const;
// returns the invalid values log if the log has a matching invalid values log
// filter
Kernel::TimeSeriesProperty<bool> *
getInvalidValuesFilter(const std::string &logName) const;
bool operator==(const LogManager &other) const;
bool operator!=(const LogManager &other) const;
......
......@@ -123,6 +123,9 @@ public:
const std::string &name,
const std::vector<std::string> &exts = std::vector<std::string>());
MultipleFileProperty(const MultipleFileProperty &) = default;
MultipleFileProperty &operator=(const MultipleFileProperty &) = default;
MultipleFileProperty *clone() const override {
return new MultipleFileProperty(*this);
}
......
......@@ -62,10 +62,6 @@ protected:
/// A vector holding the centre values.
std::vector<double> m_values;
private:
/// Private, undefined copy assignment operator
const NumericAxis &operator=(const NumericAxis &);
};
} // namespace API
......
......@@ -34,7 +34,6 @@ public:
private:
/// Owning algorithm
Algorithm *const m_alg;
Progress &operator=(const Progress &);
};
} // namespace API
......
......@@ -60,8 +60,6 @@ public:
double getMax() const override;
private:
/// Private, undefined copy assignment operator
const TextAxis &operator=(const TextAxis &);
/// A vector holding the axis values for the axis.
std::vector<std::string> m_values;
};
......
......@@ -37,11 +37,11 @@ public:
/// Default constructor
WorkspaceHistory();
/// Destructor
virtual ~WorkspaceHistory();
virtual ~WorkspaceHistory() = default;
/// Copy constructor
WorkspaceHistory(const WorkspaceHistory &);
WorkspaceHistory(const WorkspaceHistory &) = default;
/// Deleted copy assignment operator
WorkspaceHistory &operator=(const WorkspaceHistory &) = delete;
WorkspaceHistory &operator=(const WorkspaceHistory &) = default;
/// Retrieve the algorithm history list
const AlgorithmHistories &getAlgorithmHistories() const;
/// Retrieve the environment history
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment