Infer planet properties using AGNI as a static structure model
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inferagni-26.3.18.tar.gz.
File metadata
- Download URL: inferagni-26.3.18.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c6a8f40be16e9cdc5e29582566454338d168e5c67f962b14a1ee879ea11ae5
|
|
| MD5 |
b6bc5c4da35739dccb3ac0f5c941d646
|
|
| BLAKE2b-256 |
a0837c206f2404a86a921564f7ffd3c94b2a4fe8b5d795fde3f8a3827f45750a
|
Provenance
The following attestation bundles were made for inferagni-26.3.18.tar.gz:
Publisher:
publish.yaml on nichollsh/InferAGNI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferagni-26.3.18.tar.gz -
Subject digest:
38c6a8f40be16e9cdc5e29582566454338d168e5c67f962b14a1ee879ea11ae5 - Sigstore transparency entry: 1165583710
- Sigstore integration time:
-
Permalink:
nichollsh/InferAGNI@d44313887630d388aee1b0a205a2b4e81cd4d334 -
Branch / Tag:
refs/tags/26.03.18 - Owner: https://github.com/nichollsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@d44313887630d388aee1b0a205a2b4e81cd4d334 -
Trigger Event:
release
-
Statement type:
File details
Details for the file inferagni-26.3.18-py3-none-any.whl.
File metadata
- Download URL: inferagni-26.3.18-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a0058b4d4e26faa19f590acb0f658652028e040738992ceb496b0389fb873bd
|
|
| MD5 |
5c0c449031ef5ee5e81976132f9b7914
|
|
| BLAKE2b-256 |
760acfdb96a1f590fb3d787af2c12792752a82babea32a4ad0bfb9fd4390bc27
|
Provenance
The following attestation bundles were made for inferagni-26.3.18-py3-none-any.whl:
Publisher:
publish.yaml on nichollsh/InferAGNI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferagni-26.3.18-py3-none-any.whl -
Subject digest:
0a0058b4d4e26faa19f590acb0f658652028e040738992ceb496b0389fb873bd - Sigstore transparency entry: 1165583781
- Sigstore integration time:
-
Permalink:
nichollsh/InferAGNI@d44313887630d388aee1b0a205a2b4e81cd4d334 -
Branch / Tag:
refs/tags/26.03.18 - Owner: https://github.com/nichollsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@d44313887630d388aee1b0a205a2b4e81cd4d334 -
Trigger Event:
release
-
Statement type: