-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from njoy/feature/distributions-part3
Feature/distributions part3
- Loading branch information
Showing
34 changed files
with
3,476 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "dryad/DistributionDataType.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
void wrapDistributionDataType( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::dryad::DistributionDataType; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::enum_< Component > component( | ||
|
||
module, | ||
"DistributionDataType", | ||
"The distribition data type for a reaction product", | ||
python::arithmetic() | ||
); | ||
|
||
// wrap the component | ||
component | ||
.value( "TwoBody", Component::TwoBody ) | ||
.value( "Uncorrelated", Component::Uncorrelated ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
#include <pybind11/operators.h> | ||
|
||
// local includes | ||
#include "definitions.hpp" | ||
#include "dryad/LegendreAngularDistributions.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
void wrapLegendreAngularDistributions( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::dryad::LegendreAngularDistributions; | ||
using LegendreAngularDistribution = njoy::dryad::LegendreAngularDistribution; | ||
using InterpolationType = njoy::dryad::InterpolationType; | ||
using ToleranceConvergence = njoy::dryad::ToleranceConvergence; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::class_< Component > component( | ||
|
||
module, | ||
"LegendreAngularDistributions", | ||
"Angular distribution data given using Legendre expansions" | ||
); | ||
|
||
// wrap the component | ||
component | ||
.def( | ||
|
||
python::init< std::vector< double >, | ||
std::vector< LegendreAngularDistribution >, | ||
std::vector< std::size_t >, | ||
std::vector< InterpolationType > >(), | ||
python::arg( "grid" ), python::arg( "distributions" ), | ||
python::arg( "boundaries" ), python::arg( "interpolants" ), | ||
"Initialise the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the angular distribution table\n" | ||
" grid the grid values\n" | ||
" distributions the distributions\n" | ||
" boundaries the boundaries of the interpolation regions\n" | ||
" interpolants the interpolation types of the interpolation regions,\n" | ||
" see InterpolationType for all interpolation types" | ||
) | ||
.def( | ||
|
||
python::init< std::vector< double >, | ||
std::vector< LegendreAngularDistribution >, | ||
InterpolationType >(), | ||
python::arg( "grid" ), python::arg( "distributions" ), | ||
python::arg( "interpolant" ) = InterpolationType::LinearLinear, | ||
"Initialise the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the multiplicity table\n" | ||
" grid the grid values\n" | ||
" distributions the distributions\n" | ||
" interpolant the interpolation type (default lin-lin),\n" | ||
" see InterpolationType for all interpolation types" | ||
) | ||
.def_property_readonly( | ||
|
||
"grid", | ||
&Component::grid, | ||
"The grid values for which distributions are given" | ||
) | ||
.def_property_readonly( | ||
|
||
"distributions", | ||
&Component::distributions, | ||
"The associated distributions" | ||
) | ||
.def( | ||
|
||
"__call__", | ||
[] ( const Component& self, double value, double cosine ) -> decltype(auto) | ||
{ return self( value, cosine ); }, | ||
python::arg( "value" ), python::arg( "cosine" ), | ||
"Evaluate the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the table\n" | ||
" value the grid value\n" | ||
" cosine the cosine value" | ||
); | ||
|
||
// add standard tabulated data definitions | ||
addStandardInterpolationTableDefinitions< Component >( component ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "dryad/ReferenceFrame.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
void wrapReferenceFrame( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::dryad::ReferenceFrame; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::enum_< Component > component( | ||
|
||
module, | ||
"ReferenceFrame", | ||
"The reference frame used to describe data", | ||
python::arithmetic() | ||
); | ||
|
||
// wrap the component | ||
component | ||
.value( "Laboratory", Component::Laboratory ) | ||
.value( "CentreOfMass", Component::CentreOfMass ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
#include <pybind11/operators.h> | ||
|
||
// local includes | ||
#include "definitions.hpp" | ||
#include "dryad/TabulatedAngularDistributions.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
void wrapTabulatedAngularDistributions( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::dryad::TabulatedAngularDistributions; | ||
using TabulatedAngularDistribution = njoy::dryad::TabulatedAngularDistribution; | ||
using InterpolationType = njoy::dryad::InterpolationType; | ||
using ToleranceConvergence = njoy::dryad::ToleranceConvergence; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::class_< Component > component( | ||
|
||
module, | ||
"TabulatedAngularDistributions", | ||
"Angular distribution data given as tables" | ||
); | ||
|
||
// wrap the component | ||
component | ||
.def( | ||
|
||
python::init< std::vector< double >, | ||
std::vector< TabulatedAngularDistribution >, | ||
std::vector< std::size_t >, | ||
std::vector< InterpolationType > >(), | ||
python::arg( "grid" ), python::arg( "distributions" ), | ||
python::arg( "boundaries" ), python::arg( "interpolants" ), | ||
"Initialise the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the angular distribution table\n" | ||
" grid the grid values\n" | ||
" distributions the distributions\n" | ||
" boundaries the boundaries of the interpolation regions\n" | ||
" interpolants the interpolation types of the interpolation regions,\n" | ||
" see InterpolationType for all interpolation types" | ||
) | ||
.def( | ||
|
||
python::init< std::vector< double >, | ||
std::vector< TabulatedAngularDistribution >, | ||
InterpolationType >(), | ||
python::arg( "grid" ), python::arg( "distributions" ), | ||
python::arg( "interpolant" ) = InterpolationType::LinearLinear, | ||
"Initialise the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the multiplicity table\n" | ||
" grid the grid values\n" | ||
" distributions the distributions\n" | ||
" interpolant the interpolation type (default lin-lin),\n" | ||
" see InterpolationType for all interpolation types" | ||
) | ||
.def_property_readonly( | ||
|
||
"grid", | ||
&Component::grid, | ||
"The grid values for which distributions are given" | ||
) | ||
.def_property_readonly( | ||
|
||
"distributions", | ||
&Component::distributions, | ||
"The associated distributions" | ||
) | ||
.def( | ||
|
||
"__call__", | ||
[] ( const Component& self, double value, double cosine ) -> decltype(auto) | ||
{ return self( value, cosine ); }, | ||
python::arg( "value" ), python::arg( "cosine" ), | ||
"Evaluate the angular distributions\n\n" | ||
"Arguments:\n" | ||
" self the table\n" | ||
" value the grid value\n" | ||
" cosine the cosine value" | ||
); | ||
|
||
// add standard tabulated data definitions | ||
addStandardInterpolationTableDefinitions< Component >( component ); | ||
} |
Oops, something went wrong.