/ditalini

A template for your awesome C++/Python scientific computing software project

Primary LanguageCMakeMIT LicenseMIT

ditalini

PyPI Version Status Python Package Status Readthedocs Status

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.

Installation

The project can be installed in a few different ways.

Get the Python Package

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)

Build with pip

The project can also be built locally. Clone this repository and then do:

pip install .

Build with CMake

The repository can also be built with CMake. Clone this repository and then do:

mkdir build
cd build
cmake ..
make

Documentation

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.

CI

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.