Skip to main content

ertkit

PyPI CI Docs License: MIT

Resistivity imaging for groundwater exploration, with an honest account of what the data can resolve.

ertkit is a Python package for inverting vertical electrical sounding (VES) data, with 2.5-D electrical resistivity tomography (ERT) to follow. Each result comes with what is needed to judge it:

  • a data error model, and a fit to the noise level rather than to every digit of the data;
  • sensitivity and depth of investigation, so that unresolved parts of a model are marked as such;
  • parameter uncertainty, with the range of equivalent models that fit the data equally well planned for release 0.2.

Why another resistivity code?

Boreholes are often sited from resistivity models whose reliability was never quantified. Open tools such as pyGIMLi, SimPEG and ResIPy already provide excellent modeling and inversion. ertkit focuses on three things: making reliability the default output, publishing a verification report with every release, and keeping the code small enough to teach from. The design document gives the full statement of need, the mathematics and the verification plan.

Installation

pip install ertkit            # Python 3.12 or later
pip install "ertkit[plot]"    # with plotting (matplotlib)

Quick start

import numpy as np
import ertkit
from ertkit import ves

truth = ves.LayeredModel(resistivity=[150.0, 30.0, 800.0], thickness=[2.0, 15.0])
survey = ves.Survey.schlumberger(ab2=np.geomspace(2.5, 200.0, 22), mn2=0.5)
data = ves.Sounding.synthetic(truth, survey, ertkit.ErrorModel(relative=0.03), rng=5)
# Field data: data = ves.read_csv("sounding.csv")

fit = ves.invert_few_layer(data, n_layers=3, rng=0)
print(fit.summary())  # layers with uncertainty factors (x/), depths +- sd, fit

smooth = ves.invert_smooth(data)
print(f"depth of investigation: {smooth.doi:.0f} m")

The first print shows:

LayerFit: chi2 = 16.1 for 22 data (target 17, ratio 0.947)
converged: True (`ftol` termination condition is satisfied.)

layer  resistivity (ohm m)    thickness (m)         depth (m)
    1      144.6 x/ 1.04          2.04 x/ 1.04           2.04 +- 0.075
    2      30.18 x/ 1.03          15.2 x/ 1.05           17.3 +- 0.69
    3      787.9 x/ 1.12      half-space
p-value: 0.517

Here x/ 1.04 means "multiplied or divided by 1.04" (one standard deviation).

Status

Release 0.1 covers vertical electrical sounding: a layered-earth forward model, few-layer inversion with linearized uncertainty, smooth inversion with sensitivity and a depth of investigation, CSV input and plotting. Planned releases:

Release Content
0.1 VES: layered-earth forward model, few-layer and smooth inversion, linearized uncertainty, sensitivity and depth of investigation
0.2 VES equivalence analysis
0.3 2.5-D ERT forward modeling
0.4 ERT inversion with an error model and cumulative sensitivity
0.5 ERT depth of investigation and uncertainty maps
0.6 Field data formats and an end-to-end field example
1.0 Stable public API

Documentation

The documentation at https://abdgafartunde.github.io/ertkit/ has the user guide, worked examples, the API reference and the verification report, generated by the test suite for each release.

Contributing

Bug reports, questions and suggestions are welcome on the issue tracker. To work on the code, install uv and run:

git clone https://github.com/abdgafartunde/ertkit.git
cd ertkit
uv sync
uv run pytest

See the contributing guide and the Code of Conduct.

Citing

Each release is archived on Zenodo with a DOI. Citation metadata are in CITATION.cff; please also cite the methods ertkit implements.

License

MIT; see LICENSE.

Metadata

Release files for ertkit 0.1.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 ertkit 0.1.0
File Size Uploaded Provenance Actions
ertkit-0.1.0.tar.gz 218.9 kB With provenance Details for ertkit-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 259.7 kB

Release files / ertkit-0.1.0.tar.gz

Download URL ertkit-0.1.0.tar.gz
Size 218.9 kB
Tags Source
SHA-256 checksum
How to use checksums
423890b57b1825a2a2254ab969cb8d2c0a2527bfbfeec6cd35820c6912800538
BLAKE2b-256 checksum
How to use checksums
ff116a740157e709b47f8cbef7b4d1c2bf0f913d33c37a3fd530fc4b7f2d3fd8
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 Oct 15, 2026.

Transparency log

Release files / ertkit-0.1.0-py3-none-any.whl

Download URL ertkit-0.1.0-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e80245665231c4998c0da777453d9e2c71a7b08f030c5fec5ab4d0f6ba1c0b0e
BLAKE2b-256 checksum
How to use checksums
dcbf5fb05fd6dc0f91c730c567955174adb012a0d3a6b0ffb1c657873c16eb7b
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 Oct 15, 2026.

Transparency log

Security for ertkit 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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ertkit-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 Oct 15, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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