Philip Mocz (2024) Flatiron Institute
A modern template for your awesome C++ scientific computing software library/app with wrappers for Python. This repository sets up a project for a standalone C++ library and app, that is also wrapped into a Python package using nanobind and scikit-build-core. The package is automatically published at PyPI with each version release. Documentation is automatically generated at readthedocs.
The project can be installed in a few different ways.
Obtain the published version of the package with:
pip install ditalini
Use the package in your own Python script, e.g.:
import ditalini
sim = ditalini.Simulation(42)
The project can also be built locally. Clone this repository and then do:
pip install .
The repository can also be built with CMake. Clone this repository and then do:
mkdir build
cd build
cmake ..
make
Documentation is automatically generated and hosted at readthedocs with each push.
First, Doxygen creates documentation for the C++ Library.
Then, Sphinx with the Breathe
extension creates a final documentation for the entire project (C++ library and Python package).
To build the documentation on your own, you can type make doxygen
and make sphinx
in the build/
directory.
The .github/workflows
directory contains this projects' continuous integration workflows
for GitHub Actions.
The python-package
workflow will automatically install Python dependencies and run tests on pushes.
The python-publish
workflow will automatically upload this repository to PyPI when a release is created. The user must set a secret PYPI_API_TOKEN
variable in Github.