(Just Another Fancy Format)
An astrochemical network parser that supports multiple reaction network formats including KIDA, UDFA, PRIZMO, KROME, and UCLCHEM.
git clone https://github.com/tgrassi/jaff.git
cd jaff
pip install .git clone https://github.com/tgrassi/jaff.git
cd jaff
pip install -e . # Editable installAfter installation, you can use the jaff command:
# Load and validate a network file
jaff networks/gas_reactions_kida.uva.2024.in
# List all species and reactions
jaff networks/test.dat --list-species --list-reactionsfrom jaff import Network
# Load a chemical network
network = Network("networks/react_COthin")
# 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.get_sympy()}")- Multi-format support: Automatically detects and parses KIDA, UDFA, PRIZMO, KROME, and UCLCHEM formats
- Validation: Checks for mass and charge conservation in reactions
- Species analysis: Automatic extraction of elemental composition and properties
- Rate calculations: Temperature-dependent rate coefficient evaluation
- ODE generation: Creates differential equations for chemical kinetics
- KIDA: Kinetic Database for Astrochemistry format Reference: A&A, 689, A63 (2024)
- UDFA: UMIST Database for Astrochemistry format Reference: A&A, 682, A109 (2024)
- PRIZMO: Uses
->separator withVARIABLES{}blocks Reference:MNRAS 494, 4471–4491 (2020) - KROME: Comma-separated values with
@format:header Reference: MNRAS 439, 2386–2419 (2014) - UCLCHEM: Comma-separated with
,NAN,marker (UNDER CONSTRUCTION)
Reference: J. Holdship et al 2017 AJ 154 38
The following variables are recognized in rate expressions:
tgas: gas temperature, Kav: visual extinction, Draine unitscrate: cosmic rays ionization rate of H2, 1/sntot: total number density, 1/cm3hnuclei: H nuclei number density, 1/cm3d2g: dust-to-gas mass ratio
Example network files can be found in the networks/ directory.
To contribute or modify JAFF:
# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
ruff format
# Lint code
ruff check src/jaff
# Organize imports
ruff check --select I --fixJAFF network exports are JSON payloads serialized to .jaff (optionally gzip-compressed as .jaff.gz).
To validate a decompressed payload against the schema:
check-jsonschema --schemafile jaff.network.schema.json test.jaff