Skip to content

AmpGen: Add self-discription to `.so`

This adds functions to the .so that make it self-describing; as an illustration of the usefulness, a python module is included that wraps an .so in a python interface (all in pure python with no dependencies). An example of use:

from ampgen import FixedLib
lib = FixedLib('../../xbuild/bin/model2.so')
model = pd.read_csv('../../xbuild/bin/model2.csv', nrows=100_000)
fcn1 = lib.FCN_all(model)
# or, a bit slower, but just to show flexibility:
fcn2 = model.apply(lib.FCN, axis=1)

I have a more extensive Jupyter notebook with examples, based on Tim's model so not shown here.

Also included are several warning fixes, GCC 6.2 support, and the return of LLVM support (lost at some point since my last pull request). Override vs. virtual have been auto-fixed by LLVM. I think this fixes everything mentioned in !226 (closed). All warnings except 2 have been fixed: returning a reference to a temp and the LLVM undefined-var-template warning.

This also allows the LHCb framework and standalone builds to both work of the same CMakeLists setup, without forcing a user to make lots of renames. It also remembers AMPGENROOT and the original compiler path, to make setting up the environment much less finicky. The number of threads has a smarter default based on your current system.

It also cleans up the code whitespacing a bit, along with adding new inconsistencies. Would love a .clang-format file to keep things consistent! Hint hint hint @tevans!

Note: On macOS, the input stream is not read correctly, but I don't think that's specific to this PR.

Edited by Henry Fredrick Schreiner

Merge request reports

Loading