Skip to content

Commit

Permalink
Add constructor with contents to pybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
austinschneider committed Sep 12, 2024
1 parent 31f769d commit d4f8826
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions projects/injection/private/pybindings/injection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,23 @@ PYBIND11_MODULE(injection,m) {

class_<PhysicalProcess, std::shared_ptr<PhysicalProcess>, Process>(m, "PhysicalProcess")
.def(init<>())
.def(init<siren::dataclasses::ParticleType, std::shared_ptr<siren::interactions::InteractionCollection>>())
.def_property("primary_type", &Process::GetPrimaryType, &Process::SetPrimaryType)
.def_property("interactions", &Process::GetInteractions, &Process::SetInteractions)
.def_property("distributions", &PhysicalProcess::GetPhysicalDistributions, &PhysicalProcess::SetPhysicalDistributions)
.def("AddPhysicalDistribution",&PhysicalProcess::AddPhysicalDistribution);

class_<PrimaryInjectionProcess, std::shared_ptr<PrimaryInjectionProcess>, Process>(m, "PrimaryInjectionProcess")
.def(init<>())
.def(init<siren::dataclasses::ParticleType, std::shared_ptr<siren::interactions::InteractionCollection>>())
.def_property("primary_type", &Process::GetPrimaryType, &Process::SetPrimaryType)
.def_property("interactions", &Process::GetInteractions, &Process::SetInteractions)
.def_property("distributions", &PrimaryInjectionProcess::GetPrimaryInjectionDistributions, &PrimaryInjectionProcess::SetPrimaryInjectionDistributions)
.def("AddPrimaryInjectionDistribution",&PrimaryInjectionProcess::AddPrimaryInjectionDistribution);

class_<SecondaryInjectionProcess, std::shared_ptr<SecondaryInjectionProcess>, Process>(m, "SecondaryInjectionProcess")
.def(init<>())
.def(init<siren::dataclasses::ParticleType, std::shared_ptr<siren::interactions::InteractionCollection>>())
.def_property("secondary_type", &SecondaryInjectionProcess::GetSecondaryType, &SecondaryInjectionProcess::SetSecondaryType)
.def_property("interactions", &Process::GetInteractions, &Process::SetInteractions)
.def_property("distributions", &SecondaryInjectionProcess::GetSecondaryInjectionDistributions, &SecondaryInjectionProcess::SetSecondaryInjectionDistributions)
Expand Down

0 comments on commit d4f8826

Please sign in to comment.