Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
a4dcc737
Commit
a4dcc737
authored
Jan 17, 2018
by
Samuel Jackson
Browse files
Apply clang format patch
parent
f46a78f0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Framework/DataObjects/src/Peak.cpp
View file @
a4dcc737
...
...
@@ -714,7 +714,9 @@ double Peak::getFinalEnergy() const { return m_finalEnergy; }
double
Peak
::
getInitialEnergy
()
const
{
return
m_initialEnergy
;
}
/** 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 */
...
...
Framework/PythonInterface/inc/MantidPythonInterface/kernel/Policies/MatrixToNumpy.h
View file @
a4dcc737
...
...
@@ -22,11 +22,11 @@
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
#include
"MantidKernel/Matrix.h"
#include
"MantidKernel/System.h"
#include
"MantidPythonInterface/kernel/Converters/CloneToNumpy.h"
#include
"MantidPythonInterface/kernel/Converters/MatrixToNDArray.h"
#include
"MantidPythonInterface/kernel/Converters/PyArrayType.h"
#include
"MantidKernel/Matrix.h"
#include
<type_traits>
...
...
@@ -95,7 +95,8 @@ template <typename ConversionPolicy> struct MatrixRefToNumpy {
boost
::
mpl
::
and_
<
std
::
is_reference
<
T
>
,
is_matrix
<
non_const_type
>>::
value
,
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 {
}
};
template
<
typename
T
>
struct
MatrixToNumpy_Requires_Matrix_Return_By_Value
{};
}
template
<
typename
T
>
struct
MatrixToNumpy_Requires_Matrix_Return_By_Value
{};
}
// namespace
/**
* Implements a return value policy that
...
...
Framework/PythonInterface/mantid/api/src/Exports/IPeak.cpp
View file @
a4dcc737
#include
"MantidGeometry/Crystal/IPeak.h"
#include
"MantidPythonInterface/kernel/Converters/PyObjectToMatrix.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/Policies/MatrixToNumpy.h"
#include
<boost/optional.hpp>
#include
<boost/python/class.hpp>
#include
<boost/python/register_ptr_to_python.hpp>
...
...
@@ -48,9 +48,8 @@ void setGoniometerMatrix(IPeak &self, const object &data) {
void
export_IPeak
()
{
// return_value_policy for read-only numpy array
typedef
return_value_policy
<
Policies
::
MatrixToNumpy
>
return_copy_to_numpy
;
typedef
return_value_policy
<
Policies
::
MatrixToNumpy
>
return_copy_to_numpy
;
register_ptr_to_python
<
IPeak
*>
();
class_
<
IPeak
,
boost
::
noncopyable
>
(
"IPeak"
,
no_init
)
...
...
@@ -110,9 +109,10 @@ void export_IPeak() {
"supplied."
)
// two argument
// overload
.
def
(
"setQSampleFrame"
,
setQSampleFrame1
,
(
arg
(
"self"
),
arg
(
"qsample_frame"
)),
"Set the peak using the peak's "
"position in reciprocal space, "
"in the sample frame."
)
(
arg
(
"self"
),
arg
(
"qsample_frame"
)),
"Set the peak using the peak's "
"position in reciprocal space, "
"in the sample frame."
)
.
def
(
"setQSampleFrame"
,
setQSampleFrame2
,
(
arg
(
"self"
),
arg
(
"qsample_frame"
),
arg
(
"distance"
)),
"Set the peak using the peak's position in reciprocal space, in the "
...
...
@@ -160,13 +160,15 @@ void export_IPeak() {
"Return the # of counts in the bin at its peak"
)
.
def
(
"setBinCount"
,
&
IPeak
::
setBinCount
,
(
arg
(
"self"
),
arg
(
"bin_count"
)),
"Set the # of counts in the bin at its peak"
)
.
def
(
"getGoniometerMatrix"
,
&
IPeak
::
getGoniometerMatrix
,
arg
(
"self"
),
return_copy_to_numpy
(),
"Get the :class:`~mantid.geometry.Goniometer` rotation matrix of this peak."
.
def
(
"getGoniometerMatrix"
,
&
IPeak
::
getGoniometerMatrix
,
arg
(
"self"
),
return_copy_to_numpy
(),
"Get the :class:`~mantid.geometry.Goniometer` rotation matrix of "
"this peak."
"
\n\n
.. versionadded:: 3.12.0"
)
.
def
(
"setGoniometerMatrix"
,
&
setGoniometerMatrix
,
(
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"
),
"For :class:`~mantid.geometry.RectangularDetector` s only, returns "
"the row (y) of the pixel of the "
...
...
Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp
View file @
a4dcc737
...
...
@@ -42,7 +42,8 @@ void setR(Goniometer &self, const object &data) {
void
export_Goniometer
()
{
// 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
;
class_
<
Goniometer
>
(
"Goniometer"
,
init
<>
(
arg
(
"self"
)))
...
...
Framework/PythonInterface/mantid/geometry/src/Exports/OrientedLattice.cpp
View file @
a4dcc737
...
...
@@ -45,7 +45,8 @@ Mantid::Kernel::V3D hklFromQ(OrientedLattice &self, const object &vec) {
void
export_OrientedLattice
()
{
/// 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
;
class_
<
OrientedLattice
,
bases
<
UnitCell
>>
(
...
...
Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp
View file @
a4dcc737
...
...
@@ -67,7 +67,8 @@ void export_UnitCell() {
.
export_values
();
/// 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
;
class_
<
UnitCell
>
(
...
...
qt/widgets/sliceviewer/src/PeaksTableColumnsDialog.cpp
View file @
a4dcc737
...
...
@@ -34,8 +34,8 @@ void PeaksTableColumnsDialog::setVisibleColumns(const std::set<QString> &cols) {
m_origVisible
.
end
());
ui
->
cb_wavelength
->
setChecked
(
isChecked
);
isChecked
=
bool
(
m_origVisible
.
find
(
QPeaksTableModel
::
ENERGY_TRANSFER
)
!=
m_origVisible
.
end
());
isChecked
=
bool
(
m_origVisible
.
find
(
QPeaksTableModel
::
ENERGY_TRANSFER
)
!=
m_origVisible
.
end
());
ui
->
cb_deltaE
->
setChecked
(
isChecked
);
isChecked
=
bool
(
m_origVisible
.
find
(
QPeaksTableModel
::
INITIAL_ENERGY
)
!=
...
...
@@ -110,7 +110,8 @@ std::set<QString> PeaksTableColumnsDialog::getVisibleColumns() {
updateChecked
(
result
,
QPeaksTableModel
::
DETID
,
ui
->
cb_detID
->
isChecked
());
updateChecked
(
result
,
QPeaksTableModel
::
WAVELENGTH
,
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
,
ui
->
cb_ei
->
isChecked
());
updateChecked
(
result
,
QPeaksTableModel
::
FINAL_ENERGY
,
ui
->
cb_ef
->
isChecked
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment