AGNI Inference Package
Inferring planet properties using AGNI as a static structure model. This package provides a Bayesian inference framework for exoplanet characterization by coupling AGNI (a static interior structure model) with atmospheric retrieval via MCMC.
Contents
- Installation
- Quick Start
- Project Structure
- Getting Started with Development
- Running Tests
- Key Modules
- Resources
External links
- AGNI Model (atmosphere climate model)
- AGNI GitHub
- Zalmoxis (interior structure model)
- Research Paper
Citation
@article{nicholls_volatile_2026,
author = {Nicholls, Harrison and Lichtenberg, Tim and Chatterjee, Richard D. and Guimond, Claire Marie and Postolec, Emma and Pierrehumbert, Raymond T.},
title = {{Volatile-rich evolution of molten super-Earth L 98-59 d}},
journal = {Nat. Astron.},
pages = {1--9},
year = {2026},
month = mar,
issn = {2397-3366},
publisher = {Nature Publishing Group},
doi = {10.1038/s41550-026-02815-8}
}
Installation
Prerequisites
- Python 3.12 or later
- A conda distribution (e.g., Miniforge)
Setup
-
Clone the repository and navigate to the directory:
git clone https://github.com/nichollsh/InferAGNI.git cd InferAGNI
-
Install the package and its dependencies:
pip install -e .
-
Download required data files:
inferagni update
Quick Start
Running Your First Inference
Once installed, retrieve properties for an exoplanet:
inferagni infer "L 98-59 d"
Available Commands
inferagni infer <planet_name>- Run atmospheric retrieval for a planetinferagni listplanets- List all available planets in the databaseinferagni planet <planet_name>- Get observed parameters for a specific planetinferagni listvars- Display available variables in the AGNI grid
Running Tests
Quick Test Commands
# Run all tests
pytest tests/
# Run a specific test file
pytest tests/test_util.py
# Run a single test
pytest tests/test_util.py::test_calc_scaleheight_basic
# Run only unit tests (fast)
pytest -m unit tests/
# Run with coverage report
coverage run -m pytest tests/
coverage report
Test Organization
Tests are organized by functionality with pytest markers:
@pytest.mark.unit- Fast unit tests (~seconds)@pytest.mark.integration- Integration tests requiring external resources@pytest.mark.slow- Long-running tests@pytest.mark.smoke- Quick validation tests
Exclude slow tests during development with pytest -m "not slow" tests/.
Code Quality
# Lint code
ruff check src/ tests/
# Format code
ruff format src/ tests/
# Run pre-commit hooks
pre-commit run --all-files
The project enforces a minimum 10% code coverage threshold in CI.
Project Structure
src/inferagni/
├── cli.py # Command-line interface (Click-based)
├── planets.py # Exoplanet database integration
├── retrieve.py # MCMC atmospheric retrieval logic
├── grid.py # AGNI grid data management
├── data.py # Data loading and caching
├── plot.py # Visualization utilities
├── util.py # Helper functions
├── data/ # Grid data and other dependencies
└── exoatlas-data/ # Bundled exoplanet database
cli.py
The command-line interface providing user-facing commands for inferring planet properties, listing available exoplanets, and inspecting grid variables.
planets.py
Integrates with the exoatlas library to manage exoplanet data. Solar system planets are bundled separately; exoplanet data is filtered to include only those with measured radii.
retrieve.py
Implements Bayesian atmospheric retrieval using MCMC sampling. Uses emcee for efficient ensemble sampling.
grid.py
Manages static grid data from AGNI model outputs. Provides interpolation and data access for interior structure calculations.
util.py
Utility functions for common calculations (scale height, dimensionless parameter conversion, LaTeX formatting) and general helpers.
plot.py
Plotting utilities using matplotlib and cmcrameri colormaps for scientific visualization.
External Libraries
- emcee - MCMC sampling
- exoatlas - Exoplanet database
- Click - CLI framework
- netCDF4 - Data file format
- NumPy/SciPy - Scientific computing
Available under GPLv3. Copyright (c) 2026 Harrison Nicholls.
Metadata
Release files for InferAGNI 26.3.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| inferagni-26.3.18.tar.gz | 44.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| inferagni-26.3.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 86.6 kB
Release files / inferagni-26.3.18.tar.gz
| Download URL | inferagni-26.3.18.tar.gz |
|---|---|
| Size | 44.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38c6a8f40be16e9cdc5e29582566454338d168e5c67f962b14a1ee879ea11ae5
|
|
BLAKE2b-256 checksum How to use checksums |
a0837c206f2404a86a921564f7ffd3c94b2a4fe8b5d795fde3f8a3827f45750a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 23, 2026.
Transparency logRelease files / inferagni-26.3.18-py3-none-any.whl
| Download URL | inferagni-26.3.18-py3-none-any.whl |
|---|---|
| Size | 42.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a0058b4d4e26faa19f590acb0f658652028e040738992ceb496b0389fb873bd
|
|
BLAKE2b-256 checksum How to use checksums |
760acfdb96a1f590fb3d787af2c12792752a82babea32a4ad0bfb9fd4390bc27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 23, 2026.
Transparency log