Metadata-Version: 2.5
Name: nautilus-astrochem
Version: 2.1.0a3
Summary: Python CLI for the Nautilus gas-grain chemistry code
Project-URL: homepage, https://gitlab.in2p3.fr/LAB/astrochem-tools/pnautilus
Project-URL: repository, https://gitlab.in2p3.fr/LAB/astrochem-tools/pnautilus
Author-email: Valentine Wakelam <valentine.wakelam@u-bordeaux.fr>, Alexandre Mechineau <alexandre.mechineau@u-bordeaux.fr>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: fortranformat>=2.0.3
Requires-Dist: h5netcdf[h5py]>=1.8.1
Requires-Dist: loguru>=0.7.3
Requires-Dist: matplotlib>=3.10.9
Requires-Dist: nautilus-astrochem-code
Requires-Dist: numpy>=2.4.6
Requires-Dist: oras>=0.2.42
Requires-Dist: pint-xarray>=0.6.1
Requires-Dist: pydantic-numpy>=8.0.1
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pyvalem>=2.8
Requires-Dist: tyro>=1.0.13
Requires-Dist: xarray>=2026.4
Description-Content-Type: text/markdown

# Nautilus gas-grain code for astrochemistry

![Stable Version](https://img.shields.io/pypi/v/nautilus_astrochem?style=for-the-badge&label=Stable)
![Python Versions](https://img.shields.io/pypi/pyversions/nautilus_astrochem?style=for-the-badge&label=Python)

> Python CLI for the Nautilus gas-grain astrochemistry code.

[![](https://img.shields.io/badge/doc-Users-green?style=for-the-badge)](https://lab.pages.in2p3.fr/astrochem-tools/nautilus-doc/ "Science & Examples")
[![](https://img.shields.io/badge/doc-IN2P3-green?style=for-the-badge)](https://lab.pages.in2p3.fr/astrochem-tools/pnautilus "Public documentation")
[![](https://img.shields.io/badge/doc-Framagit-grey?style=for-the-badge)](https://wakelam.frama.io/nautilus "Private documentation")

This package is part of the [Nautilus](https://gitlab.in2p3.fr/LAB/astrochem-tools/pnautilus) project.

It provides the `nautilus-astrochem` command, a front-end to the Fortran Nautilus code shipped by the
companion package [`nautilus-astrochem-code`](https://pypi.org/project/nautilus-astrochem-code),
plus plotting and post-processing helpers built on xarray.

## Installation

You can use classical tools like `pip` to install the package, in a virtual environment or system wide.
However, system wide installation, using pip, is not recommended, and virtual environments may make the use of the package
more difficult.

The recommended way to install `nautilus-astrochem` is to use the [`uv`](https://docs.astral.sh/uv/).
This tool allows managing python installation, environment and global installed tools easily.

After installing `uv`, you can install the package globally with:

```shell
uv tool install nautilus-astrochem@latest
```

`uv` will install the package in its own virtual environment, and make available the `nautilus-astrochem` command.
The binaries from the `nautilus-astrochem-code` package can also be made available.

> [!tip]
> You can specify a version of the package to install as such: `uv tool install nautilus-astrochem@<version>`.
> `latest` will query PyPI for the latest version.

## Usage

Each command and subcommand has its own help message.

```shell
nautilus-astrochem --help            # show help
nautilus-astrochem run --help        # run a simulation
nautilus-astrochem run-rates --help  # compute reaction rates
nautilus-astrochem plot --help       # plot abundances / major reactions
nautilus-astrochem clean --help      # clean simulation intermediates
nautilus-astrochem version           # Get version of the code
```

## Getting started

To get started with `nautilus-astrochem`, we offer a repository
[nautilus-doc](https://gitlab.in2p3.fr/LAB/astrochem-tools/nautilus-doc),
with scientific documentation and examples of use cases ready to run.
This repository is used to provide the [documentation website](https://lab.pages.in2p3.fr/astrochem-tools/nautilus-doc/),
where the content of the documentation is available.

## Tab completion

Tab completion will only work if you have installed the `nautilus-astrochem` package, and it is available in your
`PATH`

The CLI is implemented with [tyro](https://github.com/brentyi/tyro), and it provides support for tab completion in
several shells.
You can follow the instructions below extracted from
the [official documentation](https://brentyi.github.io/tyro/tab_completion/).
Refer to it for more details, in them, you will see `python 01_functions.py`, replace it by `nautilus-astrochem`.
All credits go to the authors of `tyro`.

### Fish

```shell
# (1) Create the completions directory if it doesn't exist.
mkdir -p ~/.config/fish/completions/

# (2) Write the completion script.
nautilus-astrochem --tyro-write-completion fish ~/.config/fish/completions/nautilus-astrochem.fish
```

### Zsh

```shell
# (1) Make directory for local completions.
mkdir -p ~/.zfunc

# (2) Write completion script.
nautilus-astrochem --tyro-write-completion zsh ~/.zfunc/_nautilus-astrochem
```

And if it’s not in your `.zshrc` already:

```shell
# (3) Add .zfunc to our function search path, then initialize completions.
# Ideally this should go in your .zshrc!
fpath+=~/.zfunc
autoload -Uz compinit && compinit
```

### Bash

```shell
# (1) Find and make completion directory.
completion_dir=${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions/
mkdir -p $completion_dir

# (2) Write completion scripts. The name of the completion script must match
# the name of the file.
nautilus-astrochem --tyro-write-completion bash ${completion_dir}/nautilus-astrochem
```

## Contact

Requests or questions can be sent to valentine.wakelam@u-bordeaux.fr.
