Skip to content

Feature/za #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/src/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ void addStandardSectionDefinitions( PythonClass& section ) {
[] ( const Section& self ) { return self.ZA(); },
"The ZA identifier for the section"
)
.def_property_readonly(

"target_identifier",
[] ( const Section& self ) { return self.targetIdentifier(); },
"The ZA identifier for the section"
)
.def_property_readonly(

"AWR",
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/451.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void wrapSection_1_451( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< double, double, int, int, int, int,
python::init< int, double, int, int, int, int,
double, double, int, int, int,
double, double, int, int, int,
double, int,
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/452.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void wrapSection_1_452( python::module& module, python::module& ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( double zaid, double awr, Multiplicity multiplicity )
python::init( [] ( int zaid, double awr, Multiplicity multiplicity )
{ return Section( zaid, awr,
std::move( multiplicity ) ); } ),
python::arg( "zaid" ), python::arg( "awr" ), python::arg( "multiplicity" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/455.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void wrapSection_1_455( python::module& module, python::module& viewmodule ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( double zaid, double awr, DecayConstantData constants,
python::init( [] ( int zaid, double awr, DecayConstantData constants,
Multiplicity multiplicity )
{ return Section( zaid, awr,
std::move( constants ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/456.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void wrapSection_1_456( python::module& module, python::module& ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( double zaid, double awr, Multiplicity multiplicity )
python::init( [] ( int zaid, double awr, Multiplicity multiplicity )
{ return Section( zaid, awr,
std::move( multiplicity ) ); } ),
python::arg( "zaid" ), python::arg( "awr" ), python::arg( "multiplicity" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/458.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void wrapSection_1_458( python::module& module, python::module& viewmodule ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( double zaid, double awr,
python::init( [] ( int zaid, double awr,
FissionEnergyReleaseData fissionq )
{ return Section( zaid, awr,
std::move( fissionq ) ); } ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/1/460.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void wrapSection_1_460( python::module& module, python::module& viewmodule ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( double zaid, double awr,
python::init( [] ( int zaid, double awr,
DelayedPhotonData photons )
{ return Section( zaid, awr,
std::move( photons ) ); } ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/10.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void wrapSection_10( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, long,
python::init< int, int, double, long,
std::vector< ReactionProduct >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "lis" ), python::arg( "products" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/12.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void wrapSection_12( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, PhotonProduction&& >(),
python::init< int, int, double, PhotonProduction&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "production" ),
"Initialise the section\n\n"
Expand Down
4 changes: 2 additions & 2 deletions python/src/section/13.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void wrapSection_13( python::module& module, python::module& viewmodule ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( int mt, double zaid, double awr,
python::init( [] ( int mt, int zaid, double awr,
PartialCrossSection partial )
{ return Section( mt, zaid, awr,
std::move( partial ) ); } ),
Expand All @@ -62,7 +62,7 @@ void wrapSection_13( python::module& module, python::module& viewmodule ) {
.def(

//! @todo pybind11 lambda move custom type workaround
python::init( [] ( int mt, double zaid, double awr,
python::init( [] ( int mt, int zaid, double awr,
TotalCrossSection total,
std::vector< PartialCrossSection >&& partials )
{ return Section( mt, zaid, awr,
Expand Down
8 changes: 4 additions & 4 deletions python/src/section/14.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void wrapSection_14( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, unsigned int >(),
python::init< int, int, double, unsigned int >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "nk" ),
"Initialise the section for all isotropic photons\n\n"
Expand All @@ -68,7 +68,7 @@ void wrapSection_14( python::module& module, python::module& viewmodule ) {
)
.def(

python::init< int, double, double,
python::init< int, int, double,
std::vector< PhotonDistribution >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "photons" ),
Expand All @@ -82,7 +82,7 @@ void wrapSection_14( python::module& module, python::module& viewmodule ) {
)
.def(

python::init< int, double, double,
python::init< int, int, double,
std::vector< std::array< double, 2 > >&&,
std::vector< AnisotropicPhotonDistribution >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
Expand All @@ -98,7 +98,7 @@ void wrapSection_14( python::module& module, python::module& viewmodule ) {
)
.def(

python::init< int, double, double,
python::init< int, int, double,
std::vector< double >&&,
std::vector< double >&&,
std::vector< AnisotropicPhotonDistribution >&& >(),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/15.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void wrapSection_15( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< PartialDistribution >&& >(),
python::init< int, int, double, std::vector< PartialDistribution >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "partials" ),
"Initialise the section\n\n"
Expand Down
6 changes: 3 additions & 3 deletions python/src/section/2/151.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void wrapSection_2_151( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< double, double, std::vector< Isotope >&& >(),
python::init< int, double, std::vector< Isotope >&& >(),
python::arg( "zaid" ), python::arg( "awr" ), python::arg( "isotopes" ),
"Initialise the section using isotopes\n\n"
"Arguments:\n"
Expand All @@ -116,7 +116,7 @@ void wrapSection_2_151( python::module& module, python::module& viewmodule ) {
)
.def(

python::init< double, double, bool, std::vector< ResonanceRange >&& >(),
python::init< int, double, bool, std::vector< ResonanceRange >&& >(),
python::arg( "zaid" ), python::arg( "awr" ), python::arg( "lfw" ),
python::arg( "ranges" ),
"Initialise the section using a single isotope\n\n"
Expand All @@ -129,7 +129,7 @@ void wrapSection_2_151( python::module& module, python::module& viewmodule ) {
)
.def(

python::init< double, double, double, double, double, double >(),
python::init< int, double, double, double, double, double >(),
python::arg( "zaid" ), python::arg( "awr" ), python::arg( "el" ),
python::arg( "eh" ), python::arg( "spin" ), python::arg( "ap" ),
"Initialise the section for the special case (only scattering radius is\n"
Expand Down
8 changes: 7 additions & 1 deletion python/src/section/2/151/Isotope.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void wrapIsotope( python::module& module, python::module& viewmodule ) {
component
.def(

python::init< double, double, bool, std::vector< ResonanceRange >&& >(),
python::init< int, double, bool, std::vector< ResonanceRange >&& >(),
python::arg( "zai" ), python::arg( "abn" ), python::arg( "lfw" ),
python::arg( "ranges" ),
"Initialise the component\n\n"
Expand All @@ -55,6 +55,12 @@ void wrapIsotope( python::module& module, python::module& viewmodule ) {
&Component::ZAI,
"The ZA identifier of the isotope"
)
.def_property_readonly(

"isotope_identifier",
&Component::isotopeIdentifier,
"The ZA identifier of the isotope"
)
.def_property_readonly(

"ABN",
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/2/152.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void wrapSection_2_152( python::module& module, python::module& ) {
section
.def(

python::init< double, double, bool, int, double,
python::init< int, double, bool, int, double,
std::vector< double >&&, std::vector< double >&&,
std::vector< std::vector< double > >&&,
std::vector< std::vector< double > >&&,
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/23.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void wrapSection_23( python::module& module, python::module& ) {
section
.def(

python::init< int, double, double, double, double,
python::init< int, int, double, double, double,
std::vector< long >&&, std::vector< long >&&,
std::vector< double >&&, std::vector< double >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
Expand Down
22 changes: 21 additions & 1 deletion python/src/section/26.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void wrapSection_26( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double,
python::init< int, int, double,
std::vector< ReactionProduct >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "products" ),
Expand All @@ -116,6 +116,26 @@ void wrapSection_26( python::module& module, python::module& viewmodule ) {
&Section::numberReactionProducts,
"The number of reaction products"
)
.def(

"has_reaction_product",
&Section::hasReactionProduct,
python::arg( "zap" ),
"Return whether or not the reaction product is present\n\n"
"Arguments:\n"
" self the section\n"
" zap the reaction product to retrieve"
)
.def(

"reaction_product",
&Section::reactionProduct,
python::arg( "zap" ),
"Return the requested reaction product\n\n"
"Arguments:\n"
" self the section\n"
" zap the reaction product to retrieve"
)
.def_property_readonly(

"reaction_products",
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/26/Multiplicity.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void wrapMultiplicity( python::module& module, python::module& ) {
component
.def(

python::init< double, double, int,
python::init< int, double, int,
std::vector< long >&&, std::vector< long >&&,
std::vector< double >&&, std::vector< double >&& >(),
python::arg( "zap" ), python::arg( "awi" ), python::arg( "law" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/27.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void wrapSection_27( python::module& module, python::module& ) {
section
.def(

python::init< int, double, double,
python::init< int, int, double,
std::vector< long >&&, std::vector< long >&&,
std::vector< double >&&, std::vector< double >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/28.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void wrapSection_28( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< SubshellData >&& >(),
python::init< int, int, double, std::vector< SubshellData >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "subshells" ),
"Initialise the section\n\n"
Expand Down
4 changes: 2 additions & 2 deletions python/src/section/3.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void wrapSection_3( python::module& module, python::module& ) {
section
.def(

python::init< int, double, double, double, double, long,
python::init< int, int, double, double, double, long,
std::vector< long >&&, std::vector< long >&&,
std::vector< double >&&, std::vector< double >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
Expand All @@ -52,7 +52,7 @@ void wrapSection_3( python::module& module, python::module& ) {
)
.def(

python::init< int, double, double, double, double,
python::init< int, int, double, double, double,
std::vector< double >&&, std::vector< double >&&,
long, long >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/31.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void wrapSection_31( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< ReactionBlock >&& >(),
python::init< int, int, double, std::vector< ReactionBlock >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "reactions" ),
"Initialise the section\n\n"
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/33.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void wrapSection_33( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< ReactionBlock >&& >(),
python::init< int, int, double, std::vector< ReactionBlock >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "reactions" ),
"Initialise the section\n\n"
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/34.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void wrapSection_34( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, int,
python::init< int, int, double, int,
std::vector< ReactionBlock >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "ltt" ), python::arg( "reactions" ),
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/35.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void wrapSection_35( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< SquareMatrix >&& >(),
python::init< int, int, double, std::vector< SquareMatrix >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "blocks" ),
"Initialise the section\n\n"
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/4.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void wrapSection_4( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, int, Distributions&& >(),
python::init< int, int, double, int, Distributions&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "lct" ), python::arg( "distributions" ),
"Initialise the section\n\n"
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/40.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void wrapSection_40( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, int, std::vector< LevelBlock >&& >(),
python::init< int, int, double, int, std::vector< LevelBlock >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "lis" ), python::arg( "blocks" ),
"Initialise the section\n\n"
Expand Down
2 changes: 1 addition & 1 deletion python/src/section/5.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void wrapSection_5( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, std::vector< PartialDistribution >&& >(),
python::init< int, int, double, std::vector< PartialDistribution >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "partials" ),
"Initialise the section\n\n"
Expand Down
22 changes: 21 additions & 1 deletion python/src/section/6.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void wrapSection_6( python::module& module, python::module& viewmodule ) {
section
.def(

python::init< int, double, double, int, int,
python::init< int, int, double, int, int,
std::vector< ReactionProduct >&& >(),
python::arg( "mt" ), python::arg( "zaid" ), python::arg( "awr" ),
python::arg( "jp" ), python::arg( "lct" ), python::arg( "products" ),
Expand Down Expand Up @@ -214,6 +214,26 @@ void wrapSection_6( python::module& module, python::module& viewmodule ) {
&Section::numberReactionProducts,
"The number of reaction products"
)
.def(

"has_reaction_product",
&Section::hasReactionProduct,
python::arg( "zap" ),
"Return whether or not the reaction product is present\n\n"
"Arguments:\n"
" self the section\n"
" zap the reaction product to retrieve"
)
.def(

"reaction_product",
&Section::reactionProduct,
python::arg( "zap" ),
"Return the requested reaction product\n\n"
"Arguments:\n"
" self the section\n"
" zap the reaction product to retrieve"
)
.def_property_readonly(

"reaction_products",
Expand Down
Loading