Skip to content

Commit

Permalink
alias: revert pybind Medium.components
Browse files Browse the repository at this point in the history
problem with wrapping the reference to a vector.
error: new cannot be applied to a reference type.
  • Loading branch information
THEMayo12 committed May 28, 2018
1 parent 3a39f33 commit dade213
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions private/python/pybindings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ void export_medium()
.add_property("mol_density", &Medium::GetMolDensity)
.add_property("average_nucleon_weigth", &Medium::GetMM)
.add_property("sum_nucleons", &Medium::GetSumNucleons)
.add_property("components", &Medium::GetComponents)
.add_property("num_components", &Medium::GetNumComponents)
.add_property("name", &Medium::GetName);

Expand Down Expand Up @@ -629,7 +628,6 @@ BOOST_PYTHON_MODULE(pyPROPOSAL)

to_python_converter<std::vector<std::string>, VectorToPythonList<std::string> >();

to_python_converter<std::vector<Components::Component*>, PVectorToPythonList<Components::Component*> >();
to_python_converter<std::vector<DynamicData*>, PVectorToPythonList<DynamicData*> >();
to_python_converter<std::vector<Particle*>, PVectorToPythonList<Particle*> >();

Expand All @@ -641,7 +639,6 @@ BOOST_PYTHON_MODULE(pyPROPOSAL)
iterable_converter()
.from_python<std::vector<double> >()
.from_python<std::vector<std::vector<double> > >()
.from_python<std::vector<Components::Component*> >()
.from_python<std::vector<DynamicData*> >()
// .from_python<std::vector<ParticleDef> >()
.from_python<std::vector<Particle*> >()
Expand Down
2 changes: 1 addition & 1 deletion public/PROPOSAL/medium/Medium.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Medium

// Getter
int GetNumComponents() const { return numComponents_; }
const std::vector<Components::Component*> GetComponents() const { return components_; }
const std::vector<Components::Component*>& GetComponents() const { return components_; }
double GetSumCharge() const { return sumCharge_; }
double GetZA() const { return ZA_; }
double GetI() const { return I_; }
Expand Down

0 comments on commit dade213

Please sign in to comment.