Skip to content

Conversation

henryiii
Copy link
Member

@henryiii henryiii commented Jun 24, 2017

Some additions related to building python bindings.

  • Better plotting (later fixed to support older ROOTs)
  • Restructured package, beginning support for pip and setup.py.
  • Fix missing set data (back ported to 2.0.1 devel)
  • Final PDFs bound
  • Fixes for STL containers

I'll need to cherry-pick the bugfix for the 2D plot to stable.

@codecov
Copy link

codecov bot commented Jun 24, 2017

Codecov Report

Merging #93 into master will decrease coverage by 1.14%.
The diff coverage is 69.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
- Coverage   16.58%   15.43%   -1.15%     
==========================================
  Files         139      150      +11     
  Lines        5367     6019     +652     
  Branches      487      496       +9     
==========================================
+ Hits          890      929      +39     
- Misses       4477     5090     +613
Impacted Files Coverage Δ
python/PDFs/basic/PolynomialPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/combine/AddPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/combine/EventWeightedAddPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/physics/LineshapesPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/basic/BinTransformPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/combine/MappedPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/physics/DP4Pdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/physics/TddpPdf.cpp 100% <ø> (+100%) ⬆️
python/PDFs/basic/InterHistPdf.cpp 100% <ø> (ø) ⬆️
python/PDFs/physics/ThreeGaussResolution_Aux.cpp 100% <100%> (ø)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4d7b31...5d7cd0a. Read the comment docs.

@henryiii
Copy link
Member Author

@pandeyhs remove the WIP when you are ready to merge. You can always improve the design in a separate PR until we make a final release (2.1). Or you can continue to work on this PR, that's fine too.

@henryiii
Copy link
Member Author

henryiii commented Jun 28, 2017

@pandeyhs, if you check the details on the failed Travis build above below, you'll see the line at the end of the logs type "ThreeGaussResolution" referenced unknown base type "GooFit::MixingTimeResolution"; I expect there's a missing #include somewhere. Can you take a look?


void init_TruthResolution(py::module &m) {
py::class_<TruthResolution, MixingTimeResolution>(m, "TruthResolution")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to add the empty constructor, I think .def(py::init<>())


using namespace GooFit;
namespace py = pybind11;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MixingTimeResolution has some pure virtual methods in it. So I think you'll need to do what I did in DataSet to make this work. Look at the PyBind docs under virtual functions, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Virtual functions needed to be binded as well, and that makes sense. I am just confused that I am getting successful tests and build on my computer but the pytest is failing over here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried running pytest in the build directory, and have you made sure you are using the version you built? You might need to run pip -v install . -e in the main directory, depending on which build python is picking up. You can use pip uninstall goofit to make sure you don't pick up the pip build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky part about a pure virtual function is that the class cannot be instanciated if it contains a pure virtual function (that's the point of a pure v.f.). So you have to make a special C++ class that just adds non-pure functions (using a PyBind macro) so that you can bind it (since PyBind instanciates the class as part of preparing the python version).

@henryiii henryiii changed the title [WIP] Py additions Py additions Jul 20, 2017
@henryiii henryiii merged commit a1ff5a9 into master Jul 20, 2017
@henryiii henryiii deleted the py_additions branch July 20, 2017 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants