JAFF
An astrochemical network parser and multi-language code generator
JAFF is a comprehensive library for working with astrochemical reaction networks. It provides an unified interface for parsing multiple network formats, analyzing chemical species and reactions, and generating optimized code for numerical simulations in multiple programming languages: C, C++, Fortran, Python, Rust, Julia, and R and is the first automated code generator capable of treating photo-chemistry explicitly.
-
Multi-format support
Parses
KIDA,UDFA,PRIZMO,KROMEandUCLCHEMnetworks with automatic format detection. -
Validation and Analysis
Automatically validates mass and charge conservation, and extracts elemental composition.
-
Code Generation
Generates optimized code for rates, ODEs, Jacobians, and fluxes
C,C++,Fortran,Python,Rust,Julia, andRwith optional CSE. -
Template System
Powerful template language (JAFF directives) for customizing code generation to match any simulation framework.
Quick Example
from jaff import Network
# Load a chemical network
net = Network("networks/h_photoionization/h_photo.jet")
# Access species information
print(f"Network contains {net.species.count} species")
print(f"First species: {net.species[0].name}, mass: {net.species[0].mass} gm")
# Access reactions
rea = net.reactions["H -> H+ + e-"]
print(f"Reactants: {', '.join(rea.reactants.names())}")
print(f"Products: {', '.join(rea.products.names())}")
Output
Supported Network Formats
| Format | Description | Reference |
|---|---|---|
| KIDA | Kinetic Database for Astrochemistry | A&A, 689, A63 (2024) |
| UDFA | UMIST Database for Astrochemistry | A&A, 682, A109 (2024) |
| PRIZMO | Protoplanetary disk chemistry evolution code | MNRAS 494, 4471 (2020) |
| KROME | Library for astrophysical chemistry and microphysics | MNRAS 439, 2386 (2014) |
| UCLCHEM | Gas-grain astrochemical code for Python modelling | AJ 154 38 (2017) |
What's Next?
-
Getting Started
New to JAFF? The installation documentation provides a comprehensive guide to help you get started with JAFF quickly
-
User Guide
The user guide provides in-depth information on the key concepts of Networks, Reactions and Species and how to utilize them
-
Code Generation
Use JAFF's templated code generation capabilites to generate code any any of the major programming languages to simulate chemical reactions
-
API Reference
The reference guide contains a detailed description of the functions, modules, and objects used by JAFF, assuming that you have an understanding of basic concepts
Community & Support
- GitHub Issues: Report bugs and request features at github.com/jaff-chemistry/jaff/issues
- Discussions: Ask questions and share ideas
- Contributing: See our Contributing Guide
Citation
If you use JAFF in your research, please cite:
@software{jaff2024,
title = {JAFF: Just Another Fancy Format},
author = {JAFF Team},
year = {2024},
url = {https://github.com/jaff-chemistry/jaff},
version = {0.1.0}
}
License
JAFF is released under the MIT License.
New to astrochemistry?
Check out our Basic Concepts page to learn about chemical networks, reaction rates, and how JAFF can help your research.
Ready to dive in?
Jump straight to the Quick Start Guide to start using JAFF in minutes!