Skip to content

JAFF

Just Another Fancy Format
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, KROME and UCLCHEM networks 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, and R with 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

Network contains 3 species
First species: H, mass: 1.008 gm
Reactants: H
Products: H+, e-

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

    Installation Guide

  • User Guide


    The user guide provides in-depth information on the key concepts of Networks, Reactions and Species and how to utilize them

    User Guide

  • Code Generation


    Use JAFF's templated code generation capabilites to generate code any any of the major programming languages to simulate chemical reactions

    Code Generation Guide

  • 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

    API Docs


Community & Support


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!