Skip to main content

pytheriak

DOI

Python wrapper functions for Theriak-Domino.

Installation

PyPI Compatible Python Versions

You can install the package from pypi.org. Run the following to install:

pip install pytheriak

Usage

Run theriak from your python script

Import the wrapper module.

from pytheriak import wrapper

First, create a TherCaller-object.
The programs_dir must be set to the Programs directory of your Theriak-Domino installation. Specify the database (ensure that you correctly specify the file extension e.g., .txt or .bs). Specify your version of Theriak-Domino for completeness.
To run Theriak from Python, the database file should be in the same directory as your python script. On Windows you must also have a theriak.ini in the directory.

theriak = wrapper.TherCaller(programs_dir="..\Programs",
                             database="a database file",
                             theriak_version="v2023.01.02beta")

As input for Theriak define:

  1. Pressure in bars.
pressure = 4000
  1. Temperature in degree celsius.
temperature = 550
  1. Bulk composition following the Theriak-Domino format: Elements in uppercase followed by (number of moles).
bulk = "AL(2)SI(1)O(?)"

Then call minimisation() on the TherCaller-object.

rock, element_list = theriak.minimisation(pressure, temperature, bulk)

This method returns a Rock-object containing all the properties of the minimised system and an element list. The list acts as an element - index lookup table for all compositional vectors of the Rock (bulk and phase compositions).

Access the properties of the Rock-object

An easy way to checkout all accessible properties is looking at the object's attributes using ...

dir(rock)

Useful rock properties are:

rock.g_system                   # Gibbs free energy of the system [J]
rock.bulk_composition_moles     # Bulk composition [mol]
rock.mineral_assemblage         # List of stable solid phases
...

Mineral (and fluid) assemblage contain Mineral- and Fluid-Objects which hold the phase related properties.

mineral = rock.mineral_assemblage[i]

mineral.name                    # Phase name from database
mineral.n                       # Amount of phase [mol]
mineral.composition_apfu        # Mineral composition [apfu]
...

A quick, easy and pythonic way to retrieve properties is using list comprehensions.

[mineral.name for mineral in rock.mineral_assemblage]
[mineral.composition_apfu for mineral in rock.mineral_assemblage]

Cite pytheriak

The pytheriak package is registered on Zenodo. If you use pytheriak in your research, please cite it using the following DOI:

DOI

License

Theriak-Domino/pytheriak is licensed under the GNU General Public License v3.0. See LICENSE for more details.

Metadata

Release files for pytheriak 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytheriak 1.2.0
File Size Uploaded
pytheriak-1.2.0.tar.gz 320.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytheriak 1.2.0
File Interpreter ABI Platform
pytheriak-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 345.4 kB

Release files / pytheriak-1.2.0.tar.gz

Download URL pytheriak-1.2.0.tar.gz
Size 320.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8bca4a4150071a8cfd6954035e6b9c83ff815621032552e9ae9483e948f73ed1
BLAKE2b-256 checksum
How to use checksums
758a3e5f1fd8922497a6414773e08bd21bf39bdacb5db48a5dd84778b58af9de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / pytheriak-1.2.0-py3-none-any.whl

Download URL pytheriak-1.2.0-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fee98ab93a5cf23f332b6045a1e6855f4f6bb38eddaea2263eed4b52258db95e
BLAKE2b-256 checksum
How to use checksums
9325fa5800150b0188e53f20617752a1ec58577c35bd466952635ae6bf5abff5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page