Markov models of geological categories: fit facies and lithology sequences down drillholes, model transiograms, and simulate categories on 3D grids. A Rust core with Python bindings.
transiograms is for geologists, geostatisticians and resource modellers who log categories
(facies, lithology, alteration, ore type) and want their spatial structure as numbers they can
test. Along drillholes and logs it fits Markov chains, hidden Markov models and hidden semi-Markov
models. On grids it builds 3D transition models from transiograms, simulates them with T-PROGS or
Markov chain random fields (MCRF), and predicts them with MCP. The name comes from the
transiogram: the probability of finding category j at lag h from a point in category i, as a
function of h.
Docs · Guide · Examples · API · Status · Changelog
Install
pip install transiograms
With uv, uv add transiograms in a project or uv pip install transiograms in an environment.
transiograms needs CPython 3.11 or newer and ships one abi3 wheel per platform: Linux (x86_64
and aarch64, each with glibc and with musl), macOS (Intel and Apple silicon) and Windows x86_64.
NumPy is its only runtime dependency; pip install "transiograms[plot]" adds matplotlib for
tg.plot. Other platforms build from the sdist, which needs Rust 1.97 or newer. The
install page has the details.
Quick start
import numpy as np
import transiograms as tg
beds = tg.datasets.varved_sequence(seed=0)
chain = tg.MarkovChain("embedded").fit("CODE", holes="HOLE_ID", from_="FROM", to="TO", data=beds)
print(chain.transition_matrix.round(2))
print("mean thickness (m):", chain.mean_lengths.round(2))
holes = tg.datasets.layered_drillholes(seed=0)
lags = np.arange(1.0, 9.0)
exp = tg.downhole_transiogram("CODE", holes="HOLE_ID", from_="FROM", to="TO", lags=lags, data=holes)
p = np.bincount(holes["CODE"], minlength=3) / len(holes["CODE"])
vertical = tg.TransiogramModel.fit_markov(exp, proportions=p)
print("vertical mean lengths (m):", (-1 / np.diag(vertical.rates)).round(2))
print("largest residual:", np.nanmax(np.abs(vertical.residuals(exp))).round(3))
[[0. 0.83 0.17]
[0.12 0. 0.88]
[0.84 0.16 0. ]]
mean thickness (m): [1.2 0.83 0.46]
vertical mean lengths (m): [9.43 7.4 5.44]
largest residual: 0.136
The first part fits an embedded Markov chain to twelve seeded holes of sand, silt and clay beds: sand passes up into silt 83% of the time and silt into clay 88% of the time. The second part measures vertical transiograms down 25 seeded drillholes, fits a Markov model with its sills at the sample proportions, and reports the misfit. The examples go on to hidden Markov segmentation, 3D transition models and grid simulation.
What it does
- Markov chains: embedded and fixed-step transition matrices, continuous-lag generators with
P(h) = exp(Q h), tests of the Markov property, order and homogeneity, sojourn statistics, and seeded 1D simulation. - Hidden Markov and semi-Markov models: Gaussian, categorical, Poisson and Gaussian-mixture emissions; forward-backward, Viterbi and Baum-Welch; explicit duration laws (geometric, shifted Poisson, negative binomial, empirical); AIC, BIC, ICL and cross-validated state-count selection.
- Transiograms: experimental transiograms from drillholes, points and grids; Markov and entrywise models whose rows sum to one at every lag; 3D transition models from rates or mean lengths.
- Grid simulation: transition-probability cokriging and T-PROGS simulation with quenching; MCP prediction and MCRF simulation, conditioned to drillholes.
- Fit-quality reports:
tg.fit_qualitycompares T-PROGS or MCRF realizations with their model (proportions, and grid transiograms per lag with standard errors), andTransiogramModel.residualsgives the misfit of a 1D fit. The report is the same from Rust and Python.
Every stochastic routine takes a seed and gives the same bits on any number of threads. Grid
work is sized from the available memory and checked before it allocates.
Status and limits
Version 0.1.0 is the first public release and an alpha: the API can change between minor versions. Its known gaps:
- Both simulators keep a measured gap to their model. This is a limit of the methods, and
seeded tests pin each number. MCRF without hard data drifts 0.038 from the target proportions
and misses the transiograms by up to 0.19. T-PROGS with the default quench misses mid-lag
transiograms by up to 0.026. The
T-PROGS and
MCRF guides explain both, and
tg.fit_qualityreports the gap for your own model. - The container types will change.
tg.Categoriesandtg.Gridmove to a shared types package in a later release, and category codes may change fromint64toint32. - It reads no files. You pass NumPy arrays, or a mapping of column names to arrays, and get NumPy arrays back.
- Performance is not measured. No benchmark has run yet.
- PyPI only. The Rust crates are not on crates.io, and there is no conda-forge package yet;
pip install transiogramsworks inside a conda environment.
The status page lists each milestone, its acceptance test and what is still missing.
Beside the sibling libraries
transiograms is one of a family of standalone libraries for mining and geoscience. None depends on another; they exchange NumPy arrays.
| Library | What it does |
|---|---|
| boitata | Day-to-day geostatistics: drillhole checks, statistics, variograms, kriging and simulation |
| segyrs | Reading, writing and manipulation of large SEG-Y files |
| wireframes | Solids, surfaces and strings: read, write, plot, measure and combine |
| transiograms | Markov models and categorical simulation of facies and lithology |
| geophysics | Forward geophysical simulation: gravity, magnetics, seismic, DC/IP, EM, MT and GPR |
The boitata guide shows how intervals, category codes and grids pass between boitata and transiograms.
Build from source
The repository uses mise for every tool and command. In a clone:
mise install # the pinned Python, uv and helpers; rustup reads rust-toolchain.toml
mise run py:build # build the extension into .venv
mise run verify # lint, Rust tests and pytest
mise run docs-build # the documentation site, built strict
Contributing
Issues are open. A code contribution starts with an issue; see CONTRIBUTING.md.
Licence
transiograms is dual-licensed under MIT OR Apache-2.0; pick either: LICENSE-MIT,
LICENSE-APACHE. Each wheel
also carries THIRD-PARTY-LICENSES.txt, the licences of the Rust crates linked into it.
Metadata
Release files for transiograms 0.1.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 |
|---|---|---|---|---|
| transiograms-0.1.0.tar.gz | 278.1 kB | With provenance | Details for transiograms-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 10.8 MB
Release files / transiograms-0.1.0.tar.gz
| Download URL | transiograms-0.1.0.tar.gz |
|---|---|
| Size | 278.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
303e9e8044157b7cf1adf5509fb1022d717572d67cbbcc1b1382d464a9974ae3
|
|
BLAKE2b-256 checksum How to use checksums |
0014e1371fd52041d203a97688750e15411ee3bfe359fdb9f4162fb6d64bded7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-win_amd64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
60cbb8450cc1777b0810e8172b1f0bb1692164bbb962e83036ac8d666671d24e
|
|
BLAKE2b-256 checksum How to use checksums |
b8f776df23ff24a2d366f17ebe30e593da9386b0e9d92b2c2715bebca0d651cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3ee63dd1af57bd0df661ba54f289035a8c7080376f4bc1b501b8e076ef371fe6
|
|
BLAKE2b-256 checksum How to use checksums |
203c27625765227629f2f3d406c1b60fc9a551e95bbb3170b940f888eec7fd10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d9885c4614fc5bec1204a514a1e90735396e8f18f0f61c6c9be20e31f5209eb8
|
|
BLAKE2b-256 checksum How to use checksums |
2eb2b6ae2a8ea7eefa25cab55b938004091be9c123a5c1fefef0bc3e31b65b0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c5517776e226944713acf10364f423723f14faf1d230297ffc3643021d8f6ccb
|
|
BLAKE2b-256 checksum How to use checksums |
458634b37da54abd24711a7e98f1558f2f88b14af6ef6e0a6f8a50ef3152a4cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
50d228860a7913552c4cab2c406a8f88ebf929ba16bd3e8c6d6d10db67a07d93
|
|
BLAKE2b-256 checksum How to use checksums |
9c29021f5b9ba81ffdf2cd713ee625eac860125420de45892e4d1c8705ed85cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
72cece43165aa1a95a4a9d3452cbddb91a75eebd374386fbdf5d378cb27ad74c
|
|
BLAKE2b-256 checksum How to use checksums |
a0121724d86d2195d4b3c02c2f67797c920b552ab7364d061f4734d058defec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logRelease files / transiograms-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl
| Download URL | transiograms-0.1.0-cp311-abi3-macosx_10_15_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 abi3 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
69c406658825fa27540e5c46c7fa5792b2c27281105497094d51c92c3ada3d81
|
|
BLAKE2b-256 checksum How to use checksums |
371e41712379dc29ad2b19fcaa1f7cfd5f2db5eaae30b87f8cbf1f72340bf85a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 21, 2026.
Transparency logSecurity for transiograms 0.1.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 8 files in this release have been uploaded with provenance metadata.
Attestation for transiograms-0.1.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 Nov 21, 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.