Skip to content

Commit

Permalink
Adding creation of projectile-target data from ACE files on the pytho…
Browse files Browse the repository at this point in the history
…n side
  • Loading branch information
whaeck committed Aug 19, 2024
1 parent 4525b44 commit 28ce47c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 17 additions & 1 deletion python/src/ProjectileTarget.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// local includes
#include "dryad/ProjectileTarget.hpp"
#include "dryad/format/ace/createProjectileTargetFromFile.hpp"
#include "dryad/format/endf/createProjectileTargetFromFile.hpp"

// namespace aliases
Expand Down Expand Up @@ -126,10 +127,25 @@ void wrapProjectileTarget( python::module& module, python::module& ) {
return njoy::dryad::format::endf::createProjectileTargetFromFile( filename );
},
python::arg( "filename" ),
"Create a ProjectileTarget from an ENDF file\n\n"
"Create ProjectileTarget data from an ENDF file\n\n"
"If there are multiple materials in the ENDF file, only the first material\n"
"will be transformed into a ProjectileTarget.\n\n"
"Arguments:\n"
" filename the ENDF file name"
)
.def_static(

"from_ace_file",
[] ( const std::string& filename ) -> decltype(auto) {

return njoy::dryad::format::ace::createProjectileTargetFromFile( filename );
},
python::arg( "filename" ),
"Create ProjectileTarget data from an ACE file\n\n"
"Most files will produce a single ProjectileTarget. The exception here is the\n"
"photoatomic ACE file which may yield one ProjectileTarget (pre-eprdata) or two\n"
"ProjectileTarget for eprdata files.\n\n"
"Arguments:\n"
" filename the ENDF file name"
);
}
4 changes: 4 additions & 0 deletions src/dryad/format/ace/createProjectileTargetFromFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ namespace ace {
/**
* @brief Create a ProjectileTarget from an ACE file
*
* Most files will produce a single ProjectileTarget. The exception here is the
* photoatomic ACE file which may yield one ProjectileTarget (pre-eprdata) or two
* ProjectileTarget for eprdata files.
*
* @param[in] filename the ACE file name
*/
std::variant< ProjectileTarget, std::pair< ProjectileTarget, ProjectileTarget > >
Expand Down

0 comments on commit 28ce47c

Please sign in to comment.