-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDecayModes.python.cpp
More file actions
106 lines (85 loc) · 2.32 KB
/
DecayModes.python.cpp
File metadata and controls
106 lines (85 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ENDFtk/section/8/457.hpp"
#include "definitions.hpp"
#include "views.hpp"
// namespace aliases
namespace python = pybind11;
namespace mf8 {
void wrapDecayModes( python::module& module, python::module& ) {
// type aliases
using Section = njoy::ENDFtk::section::Type< 8, 457 >;
using Component = Section::DecayModes;
using DecayMode = Section::DecayMode;
// wrap views created by this section
// wrap views created by this section
// create the component
python::class_< Component > component(
module,
"DecayModes",
"MF8 MT457 section - decay modes and branching ratio information"
);
// wrap the section
component
.def(
python::init< double, double,
std::vector< DecayMode >&& >(),
python::arg( "spin" ), python::arg( "parity" ), python::arg( "modes" ),
"Initialise the component\n\n"
"Arguments:\n"
" self the component\n"
" spin the spin of the nuclide\n"
" parity the parity (used if spin is zero)\n"
" modes the decay decay modes"
)
.def(
python::init< double, double >(),
python::arg( "spin" ), python::arg( "parity" ),
"Initialise the component\n\n"
"Arguments:\n"
" self the component\n"
" spin the spin of the nuclide\n"
" parity the parity (used if spin is zero)"
)
.def_property_readonly(
"SPI",
&Component::SPI,
"The target spin"
)
.def_property_readonly(
"spin",
&Component::spin,
"The target spin"
)
.def_property_readonly(
"PAR",
&Component::PAR,
"The target parity"
)
.def_property_readonly(
"parity",
&Component::parity,
"The target parity"
)
.def_property_readonly(
"NDK",
&Component::NDK,
"The number of decay modes"
)
.def_property_readonly(
"number_decay_modes",
&Component::numberDecayModes,
"The number of decay modes"
)
.def_property_readonly(
"decay_modes",
[] ( const Component& self ) -> std::vector< DecayMode >
{ return ranges::to< std::vector< DecayMode > >( self.decayModes() ); },
"The decay mode information"
);
// add standard component definitions
addStandardComponentDefinitions< Component >( component );
}
} // namespace mf8