Skip to content

Repository files navigation

JAFF logo

JAFF

Just Another Fancy Format

A fast, multi-format astrochemical network parser with analysis, code generation, and explicit photochemistry.

License: MIT Python 3.11+ Version Status Docs

Installation · Quick Start · Formats · Documentation · Contributing


Overview

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.

Installation

Clone the repository and install with pip:

git clone https://github.com/jaff-chemistry/jaff.git
cd jaff
pip install .

Requires Python 3.11+.

Quick Start

Command Line

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 1e4

Network Parsing

The 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")

Analysis

# 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}")

Code Generation

jaffgen --template microphysics --network networks/GOW/GOW.jet

Supported languages: C · C++ · Python · Fortran · Rust · Julia · R

Supported Network Formats

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

Examples

Example network files can be found in the networks/ directory.

Contributing

Contributions are welcome! To contribute or modify JAFF, please refer to our Contributing Guide.

License

Distributed under the MIT License. See LICENSE for details.


About

An astrochemical network parser that supports multiple reaction network formats including KIDA, UDFA, PRIZMO, KROME, and UCLCHEM.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages