Skip to main content

Python API for building, running, and reading esther simulations.

Project description

ESTHER logo

ESTHER

Python API for building, running, and reading esther simulations.

PyPI Python License: CeCILL-2.1 Status


Table of contents


Requirements

  • Python ≥ 3.11 (the API uses the standard library tomllib)
  • numpy ≥ 1.21, matplotlib ≥ 3.5 (installed automatically as dependencies)
  • A working ESTHER installation

This package is a client for ESTHER: it does not ship the solver itself.

Installation

pip install esther

Quick start

On first import, ESTHER looks for a config file at ~/.config/esther/config.toml and prints setup instructions if none exists yet. Create it once:

import esther

cfg = esther.Config()
cfg.set("paths", "esther_root", "/path/to/ESTHER", autopath=True)
cfg.save()

An interactive terminal wizard that walks through the whole setup (installation root, display theme, default units) is also available in examples/Usage guide/config_assistant.py.

Everything it sets, ESTHER binary paths, temporary directories, the display theme, verbosity, and unit presets, is stored as TOML under ~/.config/esther/ and persists across sessions. It can all be read and changed later through esther.Config and esther.unit:

cfg = esther.Config()
cfg.get("paths", "esther_root")   # read back a setting
cfg.set("display", "theme", "matrix")
cfg.save()

Features

Input management Inputs are TOML files, edited through CRUD-style methods (add, get, set, pop), with layer and energy-deposition management that shifts indices automatically. Every keyword is checked against mc_complet.txt before writing, and parametric studies are declared directly in the TOML, either as a lockstep sweep or a full cartesian grid.
Fortran conversion toml_to_txt and txt_to_toml convert both ways between the TOML format and ESTHER's native .txt deck, so existing Fortran inputs can be brought into the API and new ones exported back out.
Run management Run accepts a TOML path, an Input object, or a legacy .txt file, and executes one case or many in parallel with max_workers. Progress is shown as a live terminal bar or, inside Jupyter, an HTML widget; status(), success, duration, and get_error_message() report how each run went.
Output reading Output loads a result directory lazily, exposing 1D and 2D variables as NumPy arrays through attribute access. A single global unit system (esther.unit) applies unit preferences across every load, while each Variable can also be converted individually without touching the global setting.
Plotting A thin layer over matplotlib adds ESTHER-specific behaviour on top: automatic time axes, unit-aware labels, and dispatch between time series, spatial profiles, and time × space heatmaps depending on the variable's shape.

Examples

The examples/ directory is split in two.

examples/Usage guide/ is reference material, illustrating the API's usage patterns rather than something meant to be run as-is.

File Purpose
config_assistant.py Walkthrough of the configuration options
user_guide.ipynb Tour of the main API

examples/Working examples/ are complete, runnable cases.

File Purpose
basic_example.py Full build-run-read cycle
complete_workflow.ipynb End-to-end notebook workflow

Documentation

Full API reference documentation is included in the repository under docs/. Open docs/esther.html in a browser to browse it locally.


License

CeCILL v2.1. See LICENSE.

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

esther-0.1.0b1.tar.gz (92.8 kB view details)

Uploaded Source

Built Distribution

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

esther-0.1.0b1-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

Details for the file esther-0.1.0b1.tar.gz.

File metadata

  • Download URL: esther-0.1.0b1.tar.gz
  • Upload date:
  • Size: 92.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for esther-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 7a16d0de0088dc0b2735ca824bff279e341e0b50132906d793957ec788bbe147
MD5 80ed88a2551140803d26778dea0364cc
BLAKE2b-256 3e828cbc50c46120666d756e37891a2ac06e9b8fc9236d02a3c65cd5be195659

See more details on using hashes here.

File details

Details for the file esther-0.1.0b1-py3-none-any.whl.

File metadata

  • Download URL: esther-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 102.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for esther-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8639e80adee0c022477842fbaedef1a2521ddd0ee0473e806633b248e9425bc
MD5 abf29752168f0d8b6d5fe0fe654cb6ee
BLAKE2b-256 7acf433a14e096ccf99886242c1b215b197bcaaf8655c86d65de5432892b7194

See more details on using hashes here.

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