Just Another Fancy Format
A fast, multi-format astrochemical network parser with analysis, code generation, and explicit photochemistry.
Installation · Quick Start · Formats · Documentation · Contributing
JAFF is an astrochemical network parser that reads multiple network formats, validates and analyses them, generates simulation code, and handles explicit photochemistry — all from a single tool.
- Multi-format — parse KIDA, UDFA, PRIZMO, KROME, and UCLCHEM networks
- Automatic validation — catch malformed reactions and inconsistent species
- Analysis — inspect species, reactions, masses, charges, and rates
- Code generation — emit ODE solvers in C, C++, Python, Fortran, Rust, Julia, and R
- Explicit photochemistry — first-class treatment of photoreactions
Full guides and API reference live in the Documentation.
Clone the repository and install with pip:
git clone https://github.com/jaff-chemistry/jaff.git
cd jaff
pip install .Requires Python 3.11+.
Installation provides two commands: jaffx for quick network inspection and
export, and jaffgen for code generation.
# Count species and reactions in a network
jaffx get num-species --network networks/COthin/react_COthin.jet
jaffx get num-reactions --network networks/COthin/react_COthin.jet
# Export rate coefficients over a temperature range to a text file
jaffx export txt --network networks/COthin/react_COthin.jet --tmin 10 --tmax 1e4The format is auto-detected — the same Network call reads KIDA, KROME,
PRIZMO, UDFA, and UCLCHEM files, plus JAFF's own .jaff format:
from jaff import Network
network = Network("networks/COthin/react_COthin.jet")
network = Network("networks/kida_uva_2024/gas_reactions_kida.uva.2024.jet")# Access species
for species in network.species:
print(f"{species.name}: mass={species.mass}, charge={species.charge}")
# Access reactions
for reaction in network.reactions:
print(f"{reaction.reactants}")jaffgen --template microphysics --network networks/GOW/GOW.jetSupported languages: C · C++ · Python · Fortran · Rust · Julia · R
| Format | Reference |
|---|---|
| KIDA | A&A, 689, A63 (2024) |
| UDFA | A&A, 682, A109 (2024) |
| PRIZMO | MNRAS 494, 4471–4491 (2020) |
| KROME | MNRAS 439, 2386–2419 (2014) |
| UCLCHEM | J. Holdship et al 2017 AJ 154 38 |
Example network files can be found in the networks/ directory.
Contributions are welcome! To contribute or modify JAFF, please refer to our Contributing Guide.
Distributed under the MIT License. See LICENSE for details.
