Atmospheric Chemistry and Thermodynamics Library
KINTERA is a library for atmospheric chemistry and equation of state calculations, combining C++ performance with Python accessibility through pybind11 bindings.
KINTERA provides efficient implementations of:
- Chemical kinetics calculations
- Thermodynamic equation of state
- Phase equilibrium computations
- Atmospheric chemistry models
The library is written in C++17 with Python bindings, leveraging PyTorch for tensor operations and providing GPU acceleration support via CUDA.
- High Performance: C++17 core with optional CUDA support
- Python Interface: Full Python API via pybind11
- PyTorch Integration: Native tensor operations using PyTorch
- Chemical Kinetics: Comprehensive reaction mechanism support
- Thermodynamics: Advanced equation of state calculations
- Cloud Physics: Nucleation and condensation modeling
- C++ Compiler: Support for C++17 (GCC 7+, Clang 5+, or MSVC 2017+)
- CMake: Version 3.18 or higher
- Python: Version 3.9 or higher
- NetCDF: NetCDF C library
numpytorch(version 2.7.0-2.7.1)pyharp(version 1.7.2+)pytest(for testing)
sudo apt-get update
sudo apt-get install -y build-essential cmake libnetcdf-devbrew update
brew install cmake netcdfThe simplest way to build and install KINTERA:
# 1. Install Python dependencies
pip install numpy 'torch==2.7.1' 'pyharp>=1.7.1'
# 2. Clone the repository
git clone https://github.com/chengcli/kintera.git
cd kintera
# 3. Configure and build the C++ library
cmake -B build
cmake --build build --parallel
# 4. Install the Python toolkit
pip install .KINTERA includes both C++ and Python tests.
After building and installing:
cd build/tests
ctestFull documentation is available at: https://kintera.readthedocs.io
To build documentation locally:
cd docs
pip install -r requirements.txt
make htmlDocumentation will be generated in docs/_build/html/.
A successful build saves cache files for each dependency in the .cache directory. These cache files:
- Can be safely deleted at any time
- Allow offline builds after the first successful build
- Are automatically populated on first build
To force a clean rebuild:
rm -rf .cache buildKINTERA uses pre-commit hooks for code formatting and linting:
pip install pre-commit
pre-commit install
pre-commit run --all-fileskintera/
├── src/ # C++ source code
├── python/ # Python bindings and API
│ ├── csrc/ # pybind11 binding code (C++ implementation)
│ ├── api/ # Pure Python API
│ ├── kintera.pyi # Type stub file for IDE/type checker support
│ └── py.typed # PEP 561 marker for type hints
├── tests/ # C++ and Python tests
├── examples/ # Example usage
├── docs/ # Documentation source
├── cmake/ # CMake modules and macros
└── data/ # Test data and examples
KINTERA provides full type hint support through Python stub files (.pyi):
- IDE autocomplete: Enhanced code completion in VS Code, PyCharm, etc.
- Type checking: Verify code correctness with
mypyorpyright - Documentation: Inline documentation with parameter types and examples
See python/STUB_FILES.md for more details on using type hints.
The project uses GitHub Actions for continuous integration. The CI pipeline:
- Runs pre-commit checks (formatting, linting)
- Builds on Linux and macOS
- Runs all C++ and Python tests
Releases are automatically built and published to PyPI using GitHub Actions when a new release is created on GitHub.
If you have forked this repository, please enable notifications or watch for updates to stay current with the latest developments.
See LICENSE file for details.
- Cheng Li - chengcli@umich.edu