Skip to main content

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

External links

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

  1. Clone the repository and navigate to the directory:

    git clone https://github.com/nichollsh/InferAGNI.git
    cd InferAGNI
    
  2. Install the package and its dependencies:

    pip install -e .
    
  3. 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 planet
  • inferagni listplanets - List all available planets in the database
  • inferagni planet <planet_name> - Get observed parameters for a specific planet
  • inferagni 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


Available under GPLv3. Copyright (c) 2026 Harrison Nicholls.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inferagni-26.3.17.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inferagni-26.3.17-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file inferagni-26.3.17.tar.gz.

File metadata

  • Download URL: inferagni-26.3.17.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

Hashes for inferagni-26.3.17.tar.gz
Algorithm Hash digest
SHA256 f8d276a32daed6da3c2d7df642efd3def3e78ec09aafe490f5ab27e7e274e37b
MD5 39810b4c9910e258e4a834d8947e7ffc
BLAKE2b-256 19c2f0cb40624eb002370d8439d38e899df428cd4de2544d4529625bf89e2341

See more details on using hashes here.

Provenance

The following attestation bundles were made for inferagni-26.3.17.tar.gz:

Publisher: publish.yaml on nichollsh/InferAGNI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inferagni-26.3.17-py3-none-any.whl.

File metadata

  • Download URL: inferagni-26.3.17-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

Hashes for inferagni-26.3.17-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2a04acab5983696152a6ed38751a05e709a8e858e3c1a256d00a73f45922cf
MD5 17d522c43664c563dbf653cec83bf956
BLAKE2b-256 4e45f023179458981c62ddd8c24c41083e202bca7a9fb0d6bbf879497a4711ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for inferagni-26.3.17-py3-none-any.whl:

Publisher: publish.yaml on nichollsh/InferAGNI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page