Metadata-Version: 2.5
Name: atmodeller
Version: 2.0.0
Summary: Thermochemical equilibrium modelling for planetary interiors and atmospheres
Project-URL: homepage, https://planetology.ethz.ch
Project-URL: documentation, https://atmodeller.readthedocs.io/
Project-URL: repository, https://github.com/ExPlanetology/atmodeller
Project-URL: issues, https://github.com/ExPlanetology/atmodeller/issues
Author-email: Dan J Bower <dbower@eaps.ethz.ch>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: astrobiology,atmospheres,chemical-equilibrium,degassing,equinox,exoplanets,geochemistry,habitability,jax,magma-ocean,numerical-modeling,planetary-science,thermodynamics,volatile-partitioning
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Requires-Dist: equinox>=0.13.8
Requires-Dist: ipykernel>=6.29.5
Requires-Dist: jax!=0.7.0,!=0.7.1,>0.4.38; sys_platform != 'darwin' or platform_machine != 'x86_64'
Requires-Dist: jax==0.4.38; sys_platform == 'darwin' and platform_machine == 'x86_64'
Requires-Dist: jupyter>=1.0.0
Requires-Dist: lineax==0.0.8; sys_platform == 'darwin' and platform_machine == 'x86_64'
Requires-Dist: lineax>=0.1.1; sys_platform != 'darwin' or platform_machine != 'x86_64'
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: molmass>=2026.1.8
Requires-Dist: numpy>=1.24.0
Requires-Dist: openpyxl>=3.1.2
Requires-Dist: optimistix>=0.1.0
Requires-Dist: pandas>=2.3.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: typing-extensions>=4.12.2; python_version < '3.12'
Provides-Extra: docs
Requires-Dist: doc8>=2.0.0; extra == 'docs'
Requires-Dist: myst-parser>=5.0.0; extra == 'docs'
Requires-Dist: nbsphinx-link>=1.3.1; extra == 'docs'
Requires-Dist: nbsphinx>=0.9.6; extra == 'docs'
Requires-Dist: pypandoc-binary>=1.15; extra == 'docs'
Requires-Dist: setuptools>=80.9.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=3.0.2; extra == 'docs'
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
Requires-Dist: sphinxcontrib-bibtex>=2.6.5; extra == 'docs'
Description-Content-Type: text/markdown

<p align="center">
<img src="https://raw.githubusercontent.com/ExPlanetology/atmodeller/main/docs/logo/logo800x800.png" alt="atmodeller logo" width="300"/>
</p>

# Atmodeller

[![Release 2.0.0](https://img.shields.io/badge/Release-2.0.0-blue.svg)](https://github.com/ExPlanetology/atmodeller/releases/tag/v2.0.0)
[![Python 3.11+](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![CI](https://github.com/ExPlanetology/atmodeller/actions/workflows/ci.yml/badge.svg)](https://github.com/ExPlanetology/atmodeller/actions/workflows/ci.yml)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![bear-ified](https://raw.githubusercontent.com/beartype/beartype-assets/main/badge/bear-ified.svg)](https://beartype.readthedocs.io)
[![Claude assisted](https://img.shields.io/badge/Claude-assisted-D97757)](https://anthropic.com)
[![Test coverage](https://codecov.io/gh/ExPlanetology/atmodeller/graph/badge.svg)](https://codecov.io/gh/ExPlanetology/atmodeller)

## About
Atmodeller is a Python package for thermochemical equilibrium modelling of planetary interiors and atmospheres, built on [JAX](https://docs.jax.dev/en/latest/index.html). It can also be used as a generic thermochemical equilibrium engine for other applications.

Atmodeller computes the chemical equilibrium between a planet's interior and atmosphere, solving gas-phase speciation, condensate stability and volatile solubility in silicate melt together, with real-gas equations of state for high pressures. It is designed for researchers in planetary science, exoplanet science and geochemistry who need these calculations, either standalone or as one component of a larger model. Applications include magma oceans, volcanic outgassing, and the atmospheres of super-Earths and sub-Neptunes. Users assemble a model from the species, solubility laws and equations of state they need, so the effect of each modelling choice can be explored. Because it is built on JAX, a batch of conditions is solved in one call and derivatives of the solution with respect to its inputs are available, which supports parameter sweeps, Monte Carlo sampling and gradient-based Bayesian inference.

It is released under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

## Documentation

The documentation is available online, with options to download it in EPUB or PDF format:

[https://atmodeller.readthedocs.io/](https://atmodeller.readthedocs.io/)

## Quick install

Atmodeller is a Python package that requires Python 3.11 or later. It runs on Linux, macOS and Windows, and continuous integration tests Linux and macOS. It is recommended to install Atmodeller in a dedicated Python environment. Before installation, create and activate the environment, then run:

```pip install atmodeller```

Downloading the source code is also recommended if you'd like access to the example notebooks in `notebooks/examples/`.

## Citation

If you use Atmodeller, or data from Atmodeller, please cite:

- Bower, D. J., Thompson, M. A., Hakim, K., Tian, M., and Sossi, P. A. (2025), Diversity of low-mass planet atmospheres in the C&ndash;H&ndash;O&ndash;N&ndash;S&ndash;Cl system with interior dissolution, nonideality and condensation: Application to TRAPPIST-1e and sub-Neptunes, The Astrophysical Journal, 995(1), 59, doi: <https://www.doi.org/10.3847/1538-4357/ae1479>. ArXiv e-print [2507.00499](https://arxiv.org/abs/2507.00499).

If you use version 2 of Atmodeller, please also cite:

- Bower, D. J. and Sossi, P. A. (2026), Atmodeller: A JAX-based Python package for thermochemical equilibrium of planetary interiors and atmospheres, Journal of Open Source Software, submitted.

The data from the first study above are also available for download at <https://doi.org/10.17605/OSF.IO/PC5TD>.

## Logo

You are welcome to use the Atmodeller logo in presentations, posters, and other materials. The logo is available to download in three sizes: [200 × 200](https://raw.githubusercontent.com/ExPlanetology/atmodeller/main/docs/logo/logo200x200.png), [800 × 800](https://raw.githubusercontent.com/ExPlanetology/atmodeller/main/docs/logo/logo800x800.png) and [1200 × 1200](https://raw.githubusercontent.com/ExPlanetology/atmodeller/main/docs/logo/logo1200x1200.png) pixels.

Unlike the source code, the logo is licensed under [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/). Citing Atmodeller (see [Citation](#citation)) satisfies the attribution requirement, so no separate credit is needed for the logo.

## Basic usage

Several Jupyter notebooks providing examples are in the `notebooks/examples/` directory. A simple example of how to use Atmodeller is provided below:

```python
from atmodeller import (
    ChemicalSpecies,
    EquilibriumModel,
    Parameters,
    Planet,
    ReservoirSpecies,
    console_logger,
    earth,
    get_solubility_models,
)

# Log to the console. For more detail, use console_logger(logging.DEBUG)
logger = console_logger()

# Get the available solubility models
solubility_models = get_solubility_models()
print("solubility models =", solubility_models.keys())

# Gas species
H2_g = ChemicalSpecies.create_gas("H2")
H2O_g = ChemicalSpecies.create_gas("H2O")
O2_g = ChemicalSpecies.create_gas("O2")

# H2O dissolved in the silicate melt
H2O_d = ReservoirSpecies.create_dissolved(
    "H2O", solubility=solubility_models["H2O_peridotite_sossi23"]
)

planet = Planet.from_species((H2_g, H2O_g, O2_g), silicate_melt_species=(H2O_d,))

oceans = 1
h_kg = earth.oceans_to_hydrogen_mass(oceans)
o_kg = 6.25774e20
mass_constraints = {"H": h_kg, "O": o_kg}

parameters = Parameters(planet, mass_constraints=mass_constraints)
model = EquilibriumModel(parameters)

# Solve with the default initial guess
output = model.solve_with_default()

# Check the solve was successful
output.solver_stats_to_logger()

# Quick look at the solution
output.quick_look()

# Get the complete solution as a nested dictionary
solution = output.to_dict(to_numpy=True)
print("H2O partial pressure (bar) =", solution["gas"]["species"]["partial_pressure"]["H2O_g"])

# Write the complete solution to Excel
output.to_excel("example_single")
```

## Contributing

Community development of Atmodeller is strongly encouraged, and bug fixes and new features are welcome. Please open an [issue](https://github.com/ExPlanetology/atmodeller/issues) to report a bug or request a feature. For questions, ideas, or to share how you are using Atmodeller, start a thread in [Discussions](https://github.com/ExPlanetology/atmodeller/discussions). To submit changes, see [CONTRIBUTING.md](https://github.com/ExPlanetology/atmodeller/blob/main/CONTRIBUTING.md).

## Funding
Atmodeller was created as part of a SERI-funded ERC Starting grant '2ATMO' granted to P. Sossi (Contract no. MB22.00033), with additional funding provided through a Swiss National Science Foundation (SNSF) Eccellenza Professorship (#203668).

M. Thompson was supported by NASA through the NASA Hubble Fellowship grant #HST-HF2-51545 awarded by the Space Telescope Science Institute, United States, which is operated by the Association of Universities for Research in Astronomy, Inc., for NASA under contract NAS5-26555.

K\. Hakim acknowledges the FED-tWIN research programme STELLA (Prf-2021-022) funded by the Belgian Science Policy Office (BELSPO) and the research grant G014425N funded by the Research Foundation Flanders (FWO).