Commit a4dcc737 authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Apply clang format patch

parent f46a78f0
...@@ -714,7 +714,9 @@ double Peak::getFinalEnergy() const { return m_finalEnergy; } ...@@ -714,7 +714,9 @@ double Peak::getFinalEnergy() const { return m_finalEnergy; }
double Peak::getInitialEnergy() const { return m_initialEnergy; } double Peak::getInitialEnergy() const { return m_initialEnergy; }
/** Get the difference between the initial and final neutron energy */ /** Get the difference between the initial and final neutron energy */
double Peak::getEnergyTransfer() const { return getInitialEnergy() - getFinalEnergy(); } double Peak::getEnergyTransfer() const {
return getInitialEnergy() - getFinalEnergy();
}
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Get the H index of the peak */ /** Get the H index of the peak */
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
#include "MantidKernel/Matrix.h"
#include "MantidKernel/System.h" #include "MantidKernel/System.h"
#include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h" #include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
#include "MantidPythonInterface/kernel/Converters/MatrixToNDArray.h" #include "MantidPythonInterface/kernel/Converters/MatrixToNDArray.h"
#include "MantidPythonInterface/kernel/Converters/PyArrayType.h" #include "MantidPythonInterface/kernel/Converters/PyArrayType.h"
#include "MantidKernel/Matrix.h"
#include <type_traits> #include <type_traits>
...@@ -95,7 +95,8 @@ template <typename ConversionPolicy> struct MatrixRefToNumpy { ...@@ -95,7 +95,8 @@ template <typename ConversionPolicy> struct MatrixRefToNumpy {
boost::mpl::and_<std::is_reference<T>, boost::mpl::and_<std::is_reference<T>,
is_matrix<non_const_type>>::value, is_matrix<non_const_type>>::value,
MatrixRefToNumpyImpl<non_const_type, ConversionPolicy>, MatrixRefToNumpyImpl<non_const_type, ConversionPolicy>,
MatrixRefToNumpy_Requires_Reference_To_Matrix_Return_Type<T>>::type type; MatrixRefToNumpy_Requires_Reference_To_Matrix_Return_Type<T>>::type
type;
}; };
}; };
...@@ -118,9 +119,8 @@ template <typename MatrixType> struct MatrixToNumpyImpl { ...@@ -118,9 +119,8 @@ template <typename MatrixType> struct MatrixToNumpyImpl {
} }
}; };
template <typename T> template <typename T> struct MatrixToNumpy_Requires_Matrix_Return_By_Value {};
struct MatrixToNumpy_Requires_Matrix_Return_By_Value {}; } // namespace
}
/** /**
* Implements a return value policy that * Implements a return value policy that
......
#include "MantidGeometry/Crystal/IPeak.h" #include "MantidGeometry/Crystal/IPeak.h"
#include "MantidPythonInterface/kernel/Converters/PyObjectToMatrix.h"
#include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h" #include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
#include "MantidPythonInterface/kernel/Policies/MatrixToNumpy.h" #include "MantidPythonInterface/kernel/Converters/PyObjectToMatrix.h"
#include "MantidPythonInterface/kernel/GetPointer.h" #include "MantidPythonInterface/kernel/GetPointer.h"
#include "MantidPythonInterface/kernel/Policies/MatrixToNumpy.h"
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/python/class.hpp> #include <boost/python/class.hpp>
#include <boost/python/register_ptr_to_python.hpp> #include <boost/python/register_ptr_to_python.hpp>
...@@ -48,9 +48,8 @@ void setGoniometerMatrix(IPeak &self, const object &data) { ...@@ -48,9 +48,8 @@ void setGoniometerMatrix(IPeak &self, const object &data) {
void export_IPeak() { void export_IPeak() {
// return_value_policy for read-only numpy array // return_value_policy for read-only numpy array
typedef return_value_policy<Policies::MatrixToNumpy> typedef return_value_policy<Policies::MatrixToNumpy> return_copy_to_numpy;
return_copy_to_numpy;
register_ptr_to_python<IPeak *>(); register_ptr_to_python<IPeak *>();
class_<IPeak, boost::noncopyable>("IPeak", no_init) class_<IPeak, boost::noncopyable>("IPeak", no_init)
...@@ -110,9 +109,10 @@ void export_IPeak() { ...@@ -110,9 +109,10 @@ void export_IPeak() {
"supplied.") // two argument "supplied.") // two argument
// overload // overload
.def("setQSampleFrame", setQSampleFrame1, .def("setQSampleFrame", setQSampleFrame1,
(arg("self"), arg("qsample_frame")), "Set the peak using the peak's " (arg("self"), arg("qsample_frame")),
"position in reciprocal space, " "Set the peak using the peak's "
"in the sample frame.") "position in reciprocal space, "
"in the sample frame.")
.def("setQSampleFrame", setQSampleFrame2, .def("setQSampleFrame", setQSampleFrame2,
(arg("self"), arg("qsample_frame"), arg("distance")), (arg("self"), arg("qsample_frame"), arg("distance")),
"Set the peak using the peak's position in reciprocal space, in the " "Set the peak using the peak's position in reciprocal space, in the "
...@@ -160,13 +160,15 @@ void export_IPeak() { ...@@ -160,13 +160,15 @@ void export_IPeak() {
"Return the # of counts in the bin at its peak") "Return the # of counts in the bin at its peak")
.def("setBinCount", &IPeak::setBinCount, (arg("self"), arg("bin_count")), .def("setBinCount", &IPeak::setBinCount, (arg("self"), arg("bin_count")),
"Set the # of counts in the bin at its peak") "Set the # of counts in the bin at its peak")
.def("getGoniometerMatrix", &IPeak::getGoniometerMatrix, .def("getGoniometerMatrix", &IPeak::getGoniometerMatrix, arg("self"),
arg("self"), return_copy_to_numpy(), return_copy_to_numpy(),
"Get the :class:`~mantid.geometry.Goniometer` rotation matrix of this peak." "Get the :class:`~mantid.geometry.Goniometer` rotation matrix of "
"this peak."
"\n\n.. versionadded:: 3.12.0") "\n\n.. versionadded:: 3.12.0")
.def("setGoniometerMatrix", &setGoniometerMatrix, .def("setGoniometerMatrix", &setGoniometerMatrix,
(arg("self"), arg("goniometerMatrix")), (arg("self"), arg("goniometerMatrix")),
"Set the :class:`~mantid.geometry.Goniometer` rotation matrix of this peak.") "Set the :class:`~mantid.geometry.Goniometer` rotation matrix of "
"this peak.")
.def("getRow", &IPeak::getRow, arg("self"), .def("getRow", &IPeak::getRow, arg("self"),
"For :class:`~mantid.geometry.RectangularDetector` s only, returns " "For :class:`~mantid.geometry.RectangularDetector` s only, returns "
"the row (y) of the pixel of the " "the row (y) of the pixel of the "
......
...@@ -42,7 +42,8 @@ void setR(Goniometer &self, const object &data) { ...@@ -42,7 +42,8 @@ void setR(Goniometer &self, const object &data) {
void export_Goniometer() { void export_Goniometer() {
// return_value_policy for read-only numpy array // return_value_policy for read-only numpy array
typedef return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>> typedef return_value_policy<
Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>
return_readonly_numpy; return_readonly_numpy;
class_<Goniometer>("Goniometer", init<>(arg("self"))) class_<Goniometer>("Goniometer", init<>(arg("self")))
......
...@@ -45,7 +45,8 @@ Mantid::Kernel::V3D hklFromQ(OrientedLattice &self, const object &vec) { ...@@ -45,7 +45,8 @@ Mantid::Kernel::V3D hklFromQ(OrientedLattice &self, const object &vec) {
void export_OrientedLattice() { void export_OrientedLattice() {
/// return_value_policy for read-only numpy array /// return_value_policy for read-only numpy array
typedef return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>> typedef return_value_policy<
Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>
return_readonly_numpy; return_readonly_numpy;
class_<OrientedLattice, bases<UnitCell>>( class_<OrientedLattice, bases<UnitCell>>(
......
...@@ -67,7 +67,8 @@ void export_UnitCell() { ...@@ -67,7 +67,8 @@ void export_UnitCell() {
.export_values(); .export_values();
/// return_value_policy for read-only numpy array /// return_value_policy for read-only numpy array
typedef return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>> typedef return_value_policy<
Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>
return_readonly_numpy; return_readonly_numpy;
class_<UnitCell>( class_<UnitCell>(
......
...@@ -34,8 +34,8 @@ void PeaksTableColumnsDialog::setVisibleColumns(const std::set<QString> &cols) { ...@@ -34,8 +34,8 @@ void PeaksTableColumnsDialog::setVisibleColumns(const std::set<QString> &cols) {
m_origVisible.end()); m_origVisible.end());
ui->cb_wavelength->setChecked(isChecked); ui->cb_wavelength->setChecked(isChecked);
isChecked = isChecked = bool(m_origVisible.find(QPeaksTableModel::ENERGY_TRANSFER) !=
bool(m_origVisible.find(QPeaksTableModel::ENERGY_TRANSFER) != m_origVisible.end()); m_origVisible.end());
ui->cb_deltaE->setChecked(isChecked); ui->cb_deltaE->setChecked(isChecked);
isChecked = bool(m_origVisible.find(QPeaksTableModel::INITIAL_ENERGY) != isChecked = bool(m_origVisible.find(QPeaksTableModel::INITIAL_ENERGY) !=
...@@ -110,7 +110,8 @@ std::set<QString> PeaksTableColumnsDialog::getVisibleColumns() { ...@@ -110,7 +110,8 @@ std::set<QString> PeaksTableColumnsDialog::getVisibleColumns() {
updateChecked(result, QPeaksTableModel::DETID, ui->cb_detID->isChecked()); updateChecked(result, QPeaksTableModel::DETID, ui->cb_detID->isChecked());
updateChecked(result, QPeaksTableModel::WAVELENGTH, updateChecked(result, QPeaksTableModel::WAVELENGTH,
ui->cb_wavelength->isChecked()); ui->cb_wavelength->isChecked());
updateChecked(result, QPeaksTableModel::ENERGY_TRANSFER, ui->cb_deltaE->isChecked()); updateChecked(result, QPeaksTableModel::ENERGY_TRANSFER,
ui->cb_deltaE->isChecked());
updateChecked(result, QPeaksTableModel::INITIAL_ENERGY, updateChecked(result, QPeaksTableModel::INITIAL_ENERGY,
ui->cb_ei->isChecked()); ui->cb_ei->isChecked());
updateChecked(result, QPeaksTableModel::FINAL_ENERGY, ui->cb_ef->isChecked()); updateChecked(result, QPeaksTableModel::FINAL_ENERGY, ui->cb_ef->isChecked());
......
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