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.18.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.18-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

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

Hashes for inferagni-26.3.18.tar.gz
Algorithm Hash digest
SHA256 38c6a8f40be16e9cdc5e29582566454338d168e5c67f962b14a1ee879ea11ae5
MD5 b6bc5c4da35739dccb3ac0f5c941d646
BLAKE2b-256 a0837c206f2404a86a921564f7ffd3c94b2a4fe8b5d795fde3f8a3827f45750a

See more details on using hashes here.

Provenance

The following attestation bundles were made for inferagni-26.3.18.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.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

Hashes for inferagni-26.3.18-py3-none-any.whl
Algorithm Hash digest
SHA256 0a0058b4d4e26faa19f590acb0f658652028e040738992ceb496b0389fb873bd
MD5 5c0c449031ef5ee5e81976132f9b7914
BLAKE2b-256 760acfdb96a1f590fb3d787af2c12792752a82babea32a4ad0bfb9fd4390bc27

See more details on using hashes here.

Provenance

The following attestation bundles were made for inferagni-26.3.18-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