hf-simulation
Stochastic high-frequency seismogram generation: a Rust port of EMOD3D's
hb_high_v6.0.3 (BINMOD + VERSION1), exposed to Python as a batched API.
import numpy as np
from hf_simulation import (
FaultSegment,
HfConfig,
RecordParameters,
SlipModel,
Simulator,
VelocityModel1D,
station_seeds,
)
# The four groups mirror the simulation core's own decomposition, so a
# configuration written down elsewhere deserialises straight into this.
config = HfConfig(record=RecordParameters(duration_s=40.0))
# Built once per source: the air layer, the slip-model normalisation and the
# moment scaling do not depend on where the receiver is.
simulator = Simulator(SlipModel([segment]), velocity_model, config)
waveform = simulator.run_stations( # (3, n_station, n_time), cm/s²
latitude_deg=latitudes,
longitude_deg=longitudes,
station_seed=station_seeds(1234, station_names),
)
Installation
pip install hf-simulation # core: numpy only
pip install "hf-simulation[xarray]" # adds hf_simulation.dataset.to_dataset
Status
Statistically equivalent to the production Fortran: intensity-measure means agree within ±2% at 373 of 375 endpoints tested (0 disagree; the remaining two are undetermined for want of sample size). Distribution shape agrees within ±4% on the 5th/50th/95th percentiles, and inter-frequency correlation passes Holm-corrected at 0 of 15. Each test is reported beside a null control — the same test with both sides drawn from the same program — so its false-alarm rate is measured rather than assumed. On the null, the shape test flags 11 of 375 at ±2% and none at ±4%, which is why the shape band is ±4%.
Output is not bit-identical to the Fortran: the FFT, the gamma function, the geodesic (WGS84), the pi constants and the RNG seeding all differ, and a few defects in the original are fixed. Each difference was checked statistically against the production output.
The batched interface
Simulator.run_stations takes arrays of station coordinates and seeds and
returns every station at once. A station's seed is a uint64 derived by
station_seeds through numpy.random.SeedSequence from a root seed and the
station name, so stations are independent. Three properties follow, all of them
tested:
- station order changes no waveform — so dask rechunking is free;
- simulating a subset equals slicing the whole batch — so a failed run is resumable;
- a batch of one equals that station inside a batch.
The GIL is released for the whole batch, so it parallelises under a dask thread pool. There is deliberately no internal thread pool: two schedulers competing for the same cores oversubscribe them.
Tests
pytest batch invariants, seeding properties, the stub, doctests
cargo test --workspace properties, kernel goldens, end-to-end snapshot
cargo clippy --workspace zero warnings, enforced in CI
cargo bench per-fault-size timings (HB_BENCH_SLOW=1 for alpine)
crates/hb_high/tests/snapshot.rs pins the whole pipeline against
harness/golden/snapshot.txt using a frozen draw source. It fails by design
when a change alters the draw structure (count, order or generator), because
such a change needs a statistical check rather than a sample comparison.
Re-record with UPDATE_SNAPSHOT=1 and say why in the commit message.
CI runs the Rust tests in both debug and release, which must agree with each other: a disagreement means the output depends on optimisation-level float behaviour.
uvx lefthook install sets up git hooks that mirror CI: autofixes on commit,
and the lint, format, type and docstring gates on push.
Scope
Python owns every file format; read .stoch slip models and velocity models
with source_modelling.stoch.StochFile and
workflow.realisations.HFVelocityModel1D. EMOD3D itself is not modified by
this project.
Release files for hf-simulation 2026.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hf_simulation-2026.9.1.tar.gz | 878.5 kB | Details |
Built distributions (wheels)
Total release size: 33.6 MB
Release files / hf_simulation-2026.9.1.tar.gz
| Download URL | hf_simulation-2026.9.1.tar.gz |
|---|---|
| Size | 878.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10275ebb59757de29a191c71867ee540406881bc1bc641ba01b6f6ed81d979bb
|
|
BLAKE2b-256 checksum How to use checksums |
e9ec203903eb8fe34736b222e4db58e933e2082b859b1c7568b65642e79380f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314t-win_amd64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 673.1 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b970b4e89516ebd5ea5f69086282cd2279b9aa0b15a59a3320c358caec48d913
|
|
BLAKE2b-256 checksum How to use checksums |
3c42149cf0f4f2b605cbd6e8259285d1dff8cb77b22b9678c7072b8bc8dbfb7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1f03b2dd54366a6c1440a4647d0b7d5f7374278fe034e7c4bcc467ef68c4ce88
|
|
BLAKE2b-256 checksum How to use checksums |
2b9503bf8b4faa3d739aefd6b54ec95a90d2472623307753de77d16b6fe66fdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314t-macosx_11_0_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314t-macosx_11_0_x86_64.whl |
|---|---|
| Size | 665.0 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
a66ab9c56e94eb20223d64a698d4e3786ea211998d75defb275f84fed3c3f8a7
|
|
BLAKE2b-256 checksum How to use checksums |
eb2a115ee1d56de492160f251fb1cc2894c98c34b86361b55342301f44e9fd27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 469.2 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
76baa838f4156a0ac71d4616100bf7e84aa0984cde3b6f72a9ce7030fa0d95bf
|
|
BLAKE2b-256 checksum How to use checksums |
da418fe61b06aa1c166fec14c139c74c61dbdf01af9e3b807ff72a86da9b3bda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314-win_amd64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 677.4 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
215251a77055727e5cb7af825ece6ef569a5f399ca106820af6ff6c1b3bbd1d0
|
|
BLAKE2b-256 checksum How to use checksums |
a23a25ff9178965db395cd1542fbc560cb0f8015f32a997021e037149b51b0f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9f3cdf8373d63997c0e635687f4d373e9d1454ef2f2b937539895d672bbebd9
|
|
BLAKE2b-256 checksum How to use checksums |
f0e8e0ee7811dd3111fc9a48f1f2ee93b21629328e1a635985632f13118c6571
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314-macosx_11_0_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314-macosx_11_0_x86_64.whl |
|---|---|
| Size | 670.5 kB |
| Tags | CPython 3.14 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
c6954986b321bb7550b0a96e6a63f322a9aecd3563da8da023ea944f62d3e5eb
|
|
BLAKE2b-256 checksum How to use checksums |
fc3475421f21f9ed47bd1bfea17df1c606880a2d4846c8c103e4ee1e18262976
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | hf_simulation-2026.9.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 475.2 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
33f042f98745589990c505f8a7fa47542cb59715a90db6906add254c628a3801
|
|
BLAKE2b-256 checksum How to use checksums |
656267e821e9108e0b7b595ccc4c2da6936894909f8cfbb248a600f78e2642f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp313-cp313-win_amd64.whl
| Download URL | hf_simulation-2026.9.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 661.1 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4069d69d60d0bf30af043b22e41a2ee746fe347afc3b124830b8af56f00e544e
|
|
BLAKE2b-256 checksum How to use checksums |
171bf69d0eba3005841678d7117d57907661e3da363d5074405db65ccb43664e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6b72806ab828dd5b83d774c4fb0dc51e2b4a59f6f9b95f3eb4405e652ac68753
|
|
BLAKE2b-256 checksum How to use checksums |
b7579efd827a89093eb18b4260999a5cf68fb0e9e9daa187e805b24a670e7202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp313-cp313-macosx_11_0_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp313-cp313-macosx_11_0_x86_64.whl |
|---|---|
| Size | 669.7 kB |
| Tags | CPython 3.13 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
e8e47b5c88b5c62e6263131c391d9b24848f7bb0274c9c420dd78091a3170c72
|
|
BLAKE2b-256 checksum How to use checksums |
c4c0fcbd3924da9eee17770680101d2a947cc7e1c9d0bf7e0e88d48c0be974ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | hf_simulation-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 474.4 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff024cb6f585d23dfc0ef5824fa72f6fffc5d0b0dd2ca8e1c424e7c5a3237e24
|
|
BLAKE2b-256 checksum How to use checksums |
77823b6c662109d879dec2c920ee2ae0b2e0d8c9bc24d6e86a33d8b9d9637a15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp312-cp312-win_amd64.whl
| Download URL | hf_simulation-2026.9.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 660.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4a5ad2c5251bf15ea41227743048cc05770cb465d94322bc503f2dd1fb84e421
|
|
BLAKE2b-256 checksum How to use checksums |
c2f8e6e1c6e01bc362ad59898e7fbc9a20df634a80900a6dfcc72c2db635dc18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
41d0174f69478d410c8a15b250f9c9b99c0b2f3095198e955b37db1dd8d3f927
|
|
BLAKE2b-256 checksum How to use checksums |
ff62e208ca886d902b133b38c3e37d7155471e51828d89bcd1ecda8e13aaf67b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp312-cp312-macosx_11_0_x86_64.whl
| Download URL | hf_simulation-2026.9.1-cp312-cp312-macosx_11_0_x86_64.whl |
|---|---|
| Size | 669.4 kB |
| Tags | CPython 3.12 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d0b5bdad3e9361e5117e64936a7aa849bc49f8da0a3a3228a8d219a8461f7ca
|
|
BLAKE2b-256 checksum How to use checksums |
1bb48bc6daaa3041629bc8594aa20892af0ab0ee49040e194b0384e41c11b500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency logRelease files / hf_simulation-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | hf_simulation-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 474.2 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d67a500addfd60ebbf3fddc7d6271aa96b5513acf8da1d39a887710efdcd469e
|
|
BLAKE2b-256 checksum How to use checksums |
9eacc3c69b9a66cf131ee7f7cebd253361555e33269aeb39a00e66526dcf5d73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 23, 2026.
Transparency log