Skip to content

Commit a468e22

Browse files
committed
Revert "fix: formatting" for clarity in PR.
This reverts commit 7253d99.
1 parent 7d3a225 commit a468e22

File tree

2 files changed

+98
-91
lines changed

2 files changed

+98
-91
lines changed
Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*****************************************************************************
2-
*
3-
* pyobjcryst
4-
*
5-
* File coded by: Vincent Favre-Nicolin
6-
*
7-
* See AUTHORS.txt for a list of people who contributed.
8-
* See LICENSE.txt for license information.
9-
*
10-
******************************************************************************
11-
*
12-
* boost::python bindings to ObjCryst::PowderPatternDiffraction.
13-
*
14-
* Changes from ObjCryst::PowderPatternDiffraction
15-
*
16-
* Other Changes
17-
*
18-
*****************************************************************************/
2+
*
3+
* pyobjcryst
4+
*
5+
* File coded by: Vincent Favre-Nicolin
6+
*
7+
* See AUTHORS.txt for a list of people who contributed.
8+
* See LICENSE.txt for license information.
9+
*
10+
******************************************************************************
11+
*
12+
* boost::python bindings to ObjCryst::PowderPatternDiffraction.
13+
*
14+
* Changes from ObjCryst::PowderPatternDiffraction
15+
*
16+
* Other Changes
17+
*
18+
*****************************************************************************/
1919

2020
#include <boost/python/enum.hpp>
2121
#include <boost/python/class.hpp>
@@ -25,52 +25,56 @@
2525

2626
#include <ObjCryst/ObjCryst/General.h>
2727
#include <ObjCryst/ObjCryst/PowderPattern.h>
28-
#include <ObjCryst/ObjCryst/ScatteringData.h>
28+
#include <ObjCryst/ObjCryst/ScatteringData.h>
2929

3030
namespace bp = boost::python;
3131
using namespace boost::python;
3232
using namespace ObjCryst;
3333

34+
3435
void wrap_powderpatterndiffraction()
3536
{
36-
enum_<ReflectionProfileType>("ReflectionProfileType")
37-
.value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN)
38-
.value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN)
39-
.value("PROFILE_PSEUDO_VOIGT", PROFILE_PSEUDO_VOIGT)
40-
.value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT",
41-
PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT)
42-
.value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII);
37+
enum_<ReflectionProfileType>("ReflectionProfileType")
38+
.value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN)
39+
.value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN)
40+
.value("PROFILE_PSEUDO_VOIGT", PROFILE_PSEUDO_VOIGT)
41+
.value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT",
42+
PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT)
43+
.value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII)
44+
;
4345

44-
class_<PowderPatternDiffraction,
45-
bases<PowderPatternComponent, ScatteringData>>(
46-
"PowderPatternDiffraction", no_init)
47-
.def("GetPowderPatternCalc",
48-
&PowderPatternDiffraction::GetPowderPatternCalc,
49-
return_value_policy<copy_const_reference>())
50-
.def("SetReflectionProfilePar",
51-
&PowderPatternDiffraction::SetReflectionProfilePar,
52-
(bp::arg("type") = PROFILE_PSEUDO_VOIGT,
53-
bp::arg("fwhmCagliotiW") = 1e-6,
54-
bp::arg("fwhmCagliotiU") = 0,
55-
bp::arg("fwhmCagliotiV") = 0,
56-
bp::arg("eta0") = 0.5, bp::arg("eta1") = 0))
57-
.def("GetProfile",
58-
(ReflectionProfile & (PowderPatternDiffraction::*)()) & PowderPatternDiffraction::GetProfile,
59-
return_internal_reference<>())
60-
.def("SetExtractionMode",
61-
&PowderPatternDiffraction::SetExtractionMode,
62-
(bp::arg("extract") = true, bp::arg("init") = false))
63-
.def("GetExtractionMode",
64-
&PowderPatternDiffraction::GetExtractionMode)
65-
.def("ExtractLeBail",
66-
&PowderPatternDiffraction::ExtractLeBail,
67-
(bp::arg("nbcycle") = 1))
68-
.def("SetCrystal",
69-
&PowderPatternDiffraction::SetCrystal,
70-
bp::arg("crystal"),
71-
with_custodian_and_ward<1, 2>())
72-
.def("GetNbReflBelowMaxSinThetaOvLambda",
73-
&PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda)
74-
.def("GetFhklObsSq", &PowderPatternDiffraction::GetFhklObsSq,
75-
return_value_policy<copy_const_reference>());
46+
class_<PowderPatternDiffraction,
47+
bases<PowderPatternComponent, ScatteringData> >(
48+
"PowderPatternDiffraction", no_init)
49+
.def("GetPowderPatternCalc",
50+
&PowderPatternDiffraction::GetPowderPatternCalc,
51+
return_value_policy<copy_const_reference>())
52+
.def("SetReflectionProfilePar",
53+
&PowderPatternDiffraction::SetReflectionProfilePar,
54+
(bp::arg("type")=PROFILE_PSEUDO_VOIGT,
55+
bp::arg("fwhmCagliotiW")=1e-6,
56+
bp::arg("fwhmCagliotiU")=0,
57+
bp::arg("fwhmCagliotiV")=0,
58+
bp::arg("eta0")=0.5, bp::arg("eta1")=0))
59+
.def("GetProfile",
60+
(ReflectionProfile& (PowderPatternDiffraction::*)())
61+
&PowderPatternDiffraction::GetProfile,
62+
return_internal_reference<>())
63+
.def("SetExtractionMode",
64+
&PowderPatternDiffraction::SetExtractionMode,
65+
(bp::arg("extract")=true, bp::arg("init")=false))
66+
.def("GetExtractionMode",
67+
&PowderPatternDiffraction::GetExtractionMode)
68+
.def("ExtractLeBail",
69+
&PowderPatternDiffraction::ExtractLeBail,
70+
(bp::arg("nbcycle")=1))
71+
.def("SetCrystal",
72+
&PowderPatternDiffraction::SetCrystal,
73+
bp::arg("crystal"),
74+
with_custodian_and_ward<1, 2>())
75+
.def("GetNbReflBelowMaxSinThetaOvLambda",
76+
&PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda)
77+
.def("GetFhklObsSq", &PowderPatternDiffraction::GetFhklObsSq,
78+
return_value_policy<copy_const_reference>())
79+
;
7680
}
Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*****************************************************************************
2-
*
3-
* pyobjcryst
4-
*
5-
* File coded by: Vincent Favre-Nicolin
6-
*
7-
* See AUTHORS.txt for a list of people who contributed.
8-
* See LICENSE.txt for license information.
9-
*
10-
******************************************************************************
11-
*
12-
* boost::python bindings to ObjCryst::ReflectionProfile.
13-
*
14-
* Changes from ObjCryst::ReflectionProfile
15-
*
16-
* Other Changes
17-
*
18-
*****************************************************************************/
2+
*
3+
* pyobjcryst
4+
*
5+
* File coded by: Vincent Favre-Nicolin
6+
*
7+
* See AUTHORS.txt for a list of people who contributed.
8+
* See LICENSE.txt for license information.
9+
*
10+
******************************************************************************
11+
*
12+
* boost::python bindings to ObjCryst::ReflectionProfile.
13+
*
14+
* Changes from ObjCryst::ReflectionProfile
15+
*
16+
* Other Changes
17+
*
18+
*****************************************************************************/
1919

2020
#include <boost/python/class.hpp>
2121
#include <boost/python/manage_new_object.hpp>
@@ -30,22 +30,23 @@ namespace bp = boost::python;
3030
using namespace boost::python;
3131
using namespace ObjCryst;
3232

33-
namespace
34-
{
33+
namespace {
3534

36-
class ReflectionProfileWrap : public ReflectionProfile, public wrapper<ReflectionProfile>
37-
{
35+
class ReflectionProfileWrap :
36+
public ReflectionProfile, public wrapper<ReflectionProfile>
37+
{
3838
public:
39+
3940
// Pure virtual functions
4041

41-
ReflectionProfile *CreateCopy() const
42+
ReflectionProfile* CreateCopy() const
4243
{
4344
return this->get_override("CreateCopy")();
4445
}
4546

4647
CrystVector_REAL GetProfile(
47-
const CrystVector_REAL &x, const REAL xcenter,
48-
const REAL h, const REAL k, const REAL l) const
48+
const CrystVector_REAL& x, const REAL xcenter,
49+
const REAL h, const REAL k, const REAL l) const
4950
{
5051
bp::override f = this->get_override("GetProfile");
5152
return f(x, xcenter, h, k, l);
@@ -59,28 +60,29 @@ namespace
5960
return f(relativeIntensity, xcenter, h, k, l);
6061
}
6162

62-
void XMLOutput(ostream &os, int indent) const
63+
void XMLOutput(ostream& os, int indent) const
6364
{
6465
bp::override f = this->get_override("XMLOutput");
6566
f(os, indent);
6667
}
6768

68-
void XMLInput(istream &is, const XMLCrystTag &tag)
69+
void XMLInput(istream& is, const XMLCrystTag& tag)
6970
{
7071
bp::override f = this->get_override("XMLInput");
7172
f(is, tag);
7273
}
73-
};
74+
};
75+
76+
} // namespace
7477

75-
} // namespace
7678

7779
void wrap_reflectionprofile()
7880
{
7981
class_<ReflectionProfileWrap, bases<RefinableObj>, boost::noncopyable>(
80-
"ReflectionProfile")
82+
"ReflectionProfile")
8183
.def("CreateCopy",
82-
pure_virtual(&ReflectionProfile::CreateCopy),
83-
return_value_policy<manage_new_object>())
84+
pure_virtual(&ReflectionProfile::CreateCopy),
85+
return_value_policy<manage_new_object>())
8486
.def(
8587
"GetProfile",
8688
pure_virtual((CrystVector_REAL (ReflectionProfile::*)(const CrystVector_REAL &, REAL, REAL, REAL, REAL) const) & ReflectionProfile::GetProfile),
@@ -91,9 +93,10 @@ void wrap_reflectionprofile()
9193
(bp::arg("relativeIntensity"), bp::arg("xcenter"),
9294
bp::arg("h"), bp::arg("k"), bp::arg("l")))
9395
.def("XMLOutput",
94-
pure_virtual((void (ReflectionProfile::*)(ostream &, int) const) & ReflectionProfile::XMLOutput),
95-
(bp::arg("os"), bp::arg("indent")))
96+
pure_virtual((void (ReflectionProfile::*)(ostream&, int) const)
97+
&ReflectionProfile::XMLOutput),
98+
(bp::arg("os"), bp::arg("indent")))
9699
.def("XMLInput",
97100
pure_virtual((void (ReflectionProfile::*)(istream &, const XMLCrystTag &))&ReflectionProfile::XMLInput),
98101
(bp::arg("is"), bp::arg("tag")));
99-
}
102+
}

0 commit comments

Comments
 (0)