pythomac
Lightweight post-processing for TELEMAC simulations:
extract the volume and boundary-flux printouts from a .sortie listing, quantify
the boundary-flux convergence of steady runs, and identify the optimum simulation
length - all outside the TELEMAC Python environment (only numpy, pandas, and
matplotlib are required).
Installation
pip install pythomac
Requires Python >= 3.9. The analyzed simulation must have run with the -s flag
(telemac2d.py steady2d.cas -s) and the steering file must contain
PRINTING CUMULATED FLOWRATES : YES.
Quickstart
from pythomac import extract_fluxes, calculate_convergence, get_convergence_time
fluxes_df = extract_fluxes(model_directory="/path/to/simulation",
cas_name="steady2d.cas", plotting=True)
iota_t = calculate_convergence(fluxes_df["Fluxes Boundary 1"][1:],
fluxes_df["Fluxes Boundary 2"][1:],
cas_timestep=50, plot_dir="/path/to/simulation")
idx = get_convergence_time(iota_t["Relative imbalance"], convergence_precision=1e-4)
This writes extracted-fluxes.csv + flux-convergence.png (the per-boundary
fluxes) and convergence-rate.png (the relative flux imbalance and its
convergence rate) into the simulation directory, and returns the printout index
from which the imbalance stays permanently below the tolerance. A worked example
lives in example_flux_convergence.py (with example-simulation/).
Read the full tutorial at https://hydro-informatics.com/numerics/telemac/convergence.html and the API documentation at https://pythomac.readthedocs.io.
Changelog
3.0.0
- Proper package structure: absolute in-package imports; the
sys.pathmanipulation at import time and theos.chdirside effect inextract_fluxes()are gone (the caller's working directory is never touched). - Parses the TELEMAC v9 listing format (
NUMBER OF LIQUID BOUNDARIES:with a colon), which previously yielded an empty flux table. - Runtime dependencies are declared in
pyproject.tomlwith modern floors (numpy>=1.24,pandas>=2.0,matplotlib>=3.7); Python >= 3.9. - Test suite (
pytest) and GitHub workflows for CI and PyPI publishing (Trusted Publishing). - Breaking:
from parser_output import .../from utils... import ...no longer work from copied folders - use the package imports (from pythomac import ...); Python 3.7/3.8 are no longer supported.
2.0.0 - convergence-formula correction; calculate_convergence returns the
relative imbalance alongside the rate; convergence plot improvements.
License
GPL-3.0 - see LICENSE. Parts of pythomac/parser_output.py and
pythomac/utils/ are adapted from the TELEMAC-MASCARET scripts (GPL v3).
Metadata
Release files for pythomac 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pythomac-3.0.0.tar.gz | 39.8 kB | With provenance | Details for pythomac-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pythomac-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for pythomac-3.0.0-py3-none-any.whl |
Total release size: 78.2 kB
Release files / pythomac-3.0.0.tar.gz
| Download URL | pythomac-3.0.0.tar.gz |
|---|---|
| Size | 39.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d542c533cb1bf7f02cfe525e586c95c76c417c5ad2e10684206ab5120488f7a
|
|
BLAKE2b-256 checksum How to use checksums |
a811d76a8b61955729155e6fd76825f01231f4528442cd20e7c9b190dae05517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / pythomac-3.0.0-py3-none-any.whl
| Download URL | pythomac-3.0.0-py3-none-any.whl |
|---|---|
| Size | 38.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
275d63b409a59dc4726c51fadbe09431dd76e1493cb364b58219fd6c074f384c
|
|
BLAKE2b-256 checksum How to use checksums |
ab3eb6e86413ad861d589f93a118966b383feccb857595ac5ce680801c8c5610
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logSecurity for pythomac 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pythomac-3.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.