ertkit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ertkit-0.1.0/.git_archival.txt +3 -0
- ertkit-0.1.0/.gitattributes +2 -0
- ertkit-0.1.0/.gitignore +32 -0
- ertkit-0.1.0/.mailmap +1 -0
- ertkit-0.1.0/.pre-commit-config.yaml +57 -0
- ertkit-0.1.0/.zenodo.json +28 -0
- ertkit-0.1.0/CHANGELOG.md +84 -0
- ertkit-0.1.0/CITATION.cff +26 -0
- ertkit-0.1.0/CODE_OF_CONDUCT.md +89 -0
- ertkit-0.1.0/CONTRIBUTING.md +125 -0
- ertkit-0.1.0/LICENSE +21 -0
- ertkit-0.1.0/PKG-INFO +156 -0
- ertkit-0.1.0/README.md +123 -0
- ertkit-0.1.0/ci/crosscheck.txt +4 -0
- ertkit-0.1.0/docs/_ext/verification_report.py +104 -0
- ertkit-0.1.0/docs/_templates/autosummary/class.rst +7 -0
- ertkit-0.1.0/docs/api.md +66 -0
- ertkit-0.1.0/docs/changelog.md +2 -0
- ertkit-0.1.0/docs/citing.md +9 -0
- ertkit-0.1.0/docs/conf.py +80 -0
- ertkit-0.1.0/docs/contributing.md +2 -0
- ertkit-0.1.0/docs/dev/design.md +845 -0
- ertkit-0.1.0/docs/dev/index.md +9 -0
- ertkit-0.1.0/docs/index.md +54 -0
- ertkit-0.1.0/docs/install.md +35 -0
- ertkit-0.1.0/docs/roadmap.md +18 -0
- ertkit-0.1.0/docs/user_guide/ves.md +239 -0
- ertkit-0.1.0/docs/verification.md +21 -0
- ertkit-0.1.0/examples/README.rst +5 -0
- ertkit-0.1.0/examples/plot_01_few_layer_inversion.py +65 -0
- ertkit-0.1.0/examples/plot_02_smooth_inversion.py +82 -0
- ertkit-0.1.0/examples/plot_03_equivalence.py +78 -0
- ertkit-0.1.0/examples/plot_04_static_shift.py +66 -0
- ertkit-0.1.0/examples/plot_05_read_csv.py +56 -0
- ertkit-0.1.0/examples/plot_06_check_installation.py +11 -0
- ertkit-0.1.0/pyproject.toml +163 -0
- ertkit-0.1.0/src/ertkit/__init__.py +24 -0
- ertkit-0.1.0/src/ertkit/_linalg.py +32 -0
- ertkit-0.1.0/src/ertkit/_show_versions.py +49 -0
- ertkit-0.1.0/src/ertkit/_version.py +24 -0
- ertkit-0.1.0/src/ertkit/_warnings.py +18 -0
- ertkit-0.1.0/src/ertkit/arrays.py +71 -0
- ertkit-0.1.0/src/ertkit/noise.py +134 -0
- ertkit-0.1.0/src/ertkit/plot/__init__.py +19 -0
- ertkit-0.1.0/src/ertkit/plot/_ves.py +234 -0
- ertkit-0.1.0/src/ertkit/py.typed +0 -0
- ertkit-0.1.0/src/ertkit/results.py +82 -0
- ertkit-0.1.0/src/ertkit/ves/__init__.py +28 -0
- ertkit-0.1.0/src/ertkit/ves/data.py +167 -0
- ertkit-0.1.0/src/ertkit/ves/forward.py +232 -0
- ertkit-0.1.0/src/ertkit/ves/invert.py +632 -0
- ertkit-0.1.0/src/ertkit/ves/io.py +179 -0
- ertkit-0.1.0/src/ertkit/ves/model.py +86 -0
- ertkit-0.1.0/src/ertkit/ves/smooth.py +508 -0
- ertkit-0.1.0/src/ertkit/ves/survey.py +119 -0
- ertkit-0.1.0/tests/analytic_solutions.py +40 -0
- ertkit-0.1.0/tests/conftest.py +54 -0
- ertkit-0.1.0/tests/crosscheck/test_crosscheck_ves.py +103 -0
- ertkit-0.1.0/tests/test_arrays.py +45 -0
- ertkit-0.1.0/tests/test_linalg.py +23 -0
- ertkit-0.1.0/tests/test_noise.py +50 -0
- ertkit-0.1.0/tests/test_package.py +69 -0
- ertkit-0.1.0/tests/test_plot.py +103 -0
- ertkit-0.1.0/tests/verification_report.py +55 -0
- ertkit-0.1.0/tests/ves/test_data.py +150 -0
- ertkit-0.1.0/tests/ves/test_forward.py +245 -0
- ertkit-0.1.0/tests/ves/test_invert_few_layer.py +305 -0
- ertkit-0.1.0/tests/ves/test_invert_smooth.py +339 -0
- ertkit-0.1.0/tests/ves/test_model_survey.py +78 -0
- ertkit-0.1.0/tests/ves/test_review_regressions.py +232 -0
- ertkit-0.1.0/uv.lock +1956 -0
ertkit-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.venv/
|
|
8
|
+
|
|
9
|
+
# Generated by hatch-vcs at build time
|
|
10
|
+
src/ertkit/_version.py
|
|
11
|
+
|
|
12
|
+
# Tools
|
|
13
|
+
.coverage
|
|
14
|
+
.coverage.*
|
|
15
|
+
coverage.xml
|
|
16
|
+
htmlcov/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
.hypothesis/
|
|
21
|
+
|
|
22
|
+
# Documentation build output
|
|
23
|
+
docs/_build/
|
|
24
|
+
docs/auto_examples/
|
|
25
|
+
docs/generated/
|
|
26
|
+
docs/_generated/
|
|
27
|
+
docs/sg_execution_times.rst
|
|
28
|
+
|
|
29
|
+
# Editors and operating systems
|
|
30
|
+
.DS_Store
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
ertkit-0.1.0/.mailmap
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Abd'gafar Tunde Tiamiyu <abdgafartunde@gmail.com> abdgafartunde <abdgafartunde@gmail.com>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Hooks are updated monthly by pre-commit.ci when it is enabled for the
|
|
2
|
+
# repository, and otherwise with `uv run pre-commit autoupdate` before each
|
|
3
|
+
# release (CONTRIBUTING.md).
|
|
4
|
+
ci:
|
|
5
|
+
autoupdate_schedule: monthly
|
|
6
|
+
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
|
|
7
|
+
autofix_commit_msg: "style: pre-commit fixes"
|
|
8
|
+
|
|
9
|
+
repos:
|
|
10
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
11
|
+
rev: v6.0.0
|
|
12
|
+
hooks:
|
|
13
|
+
- id: check-added-large-files
|
|
14
|
+
- id: check-case-conflict
|
|
15
|
+
- id: check-merge-conflict
|
|
16
|
+
- id: check-toml
|
|
17
|
+
- id: check-yaml
|
|
18
|
+
- id: end-of-file-fixer
|
|
19
|
+
- id: mixed-line-ending
|
|
20
|
+
args: [--fix=lf]
|
|
21
|
+
- id: trailing-whitespace
|
|
22
|
+
|
|
23
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
24
|
+
rev: v0.17.0
|
|
25
|
+
hooks:
|
|
26
|
+
- id: ruff-check
|
|
27
|
+
args: [--fix, --show-fixes, --exit-non-zero-on-fix]
|
|
28
|
+
- id: ruff-format
|
|
29
|
+
|
|
30
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
|
31
|
+
rev: v0.25
|
|
32
|
+
hooks:
|
|
33
|
+
- id: validate-pyproject
|
|
34
|
+
|
|
35
|
+
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
36
|
+
rev: 0.38.2
|
|
37
|
+
hooks:
|
|
38
|
+
- id: check-github-workflows
|
|
39
|
+
- id: check-dependabot
|
|
40
|
+
|
|
41
|
+
- repo: https://github.com/codespell-project/codespell
|
|
42
|
+
rev: v2.4.3
|
|
43
|
+
hooks:
|
|
44
|
+
- id: codespell
|
|
45
|
+
additional_dependencies: [tomli]
|
|
46
|
+
|
|
47
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
48
|
+
rev: v1.10.0
|
|
49
|
+
hooks:
|
|
50
|
+
- id: rst-backticks
|
|
51
|
+
- id: rst-directive-colons
|
|
52
|
+
- id: rst-inline-touching-normal
|
|
53
|
+
|
|
54
|
+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
|
|
55
|
+
rev: v1.30.1
|
|
56
|
+
hooks:
|
|
57
|
+
- id: zizmor
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"upload_type": "software",
|
|
3
|
+
"title": "ertkit: resistivity inversion for groundwater exploration, with uncertainty and depth of investigation",
|
|
4
|
+
"creators": [
|
|
5
|
+
{
|
|
6
|
+
"name": "Tiamiyu, Abd'gafar Tunde",
|
|
7
|
+
"affiliation": "School of Mathematics, Jilin University",
|
|
8
|
+
"orcid": "0000-0003-1641-7196"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"description": "ertkit is a Python package for inverting vertical electrical sounding (VES) data for groundwater exploration; 2.5-D electrical resistivity tomography (ERT) follows in later releases. Each result states what the data can resolve: a data error model and a fit to the noise level, linearized parameter uncertainty, sensitivity and a depth of investigation. Every release publishes a verification report generated by its test suite.",
|
|
12
|
+
"license": "mit",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vertical electrical sounding",
|
|
15
|
+
"electrical resistivity tomography",
|
|
16
|
+
"geophysics",
|
|
17
|
+
"groundwater",
|
|
18
|
+
"inverse problems",
|
|
19
|
+
"uncertainty quantification"
|
|
20
|
+
],
|
|
21
|
+
"related_identifiers": [
|
|
22
|
+
{
|
|
23
|
+
"identifier": "https://abdgafartunde.github.io/ertkit/",
|
|
24
|
+
"relation": "isDocumentedBy",
|
|
25
|
+
"scheme": "url"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ertkit are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/), and the
|
|
5
|
+
project uses [semantic versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-10-15
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Project foundation (milestone 0.0): packaging with versions from git tags,
|
|
14
|
+
continuous integration on Linux, Windows and macOS, a documentation website,
|
|
15
|
+
a release pipeline using trusted publishing, and contributor guidelines.
|
|
16
|
+
- Design document with the mathematics, the verification plan and the
|
|
17
|
+
engineering standards (`docs/dev/design.md`).
|
|
18
|
+
- `ertkit.show_versions()` for bug reports.
|
|
19
|
+
- VES forward model: `ves.LayeredModel`, `ves.Survey` (Schlumberger soundings
|
|
20
|
+
with finite and changing MN, and Wenner soundings), `ves.forward`,
|
|
21
|
+
`ves.potential`, and the building blocks `ves.resistivity_transform` and
|
|
22
|
+
`ves.hankel_j0` (Guptasarma and Singh 120-point filter).
|
|
23
|
+
- `ErrorModel`: measurement errors on the transfer resistance, with a 3%
|
|
24
|
+
relative default that includes a modeling-error floor, and a warning when
|
|
25
|
+
the relative part looks like a percentage (above 0.5).
|
|
26
|
+
- `ves.Sounding` (data with their error model; readings with R <= 0 or below
|
|
27
|
+
the noise level are removed with a `DataWarning` that lists their AB/2),
|
|
28
|
+
synthetic data with `Sounding.synthetic`, and CSV input and output with
|
|
29
|
+
`ves.read_csv` and `ves.write_csv` (explicit text encoding; empty
|
|
30
|
+
spreadsheet rows are skipped, and errors give the line and, for a file in
|
|
31
|
+
another encoding, how to read it).
|
|
32
|
+
- Warning categories `ConvergenceWarning` and `DataWarning`.
|
|
33
|
+
- Few-layer VES inversion, `ves.invert_few_layer`: log parameters, a
|
|
34
|
+
trust-region least-squares search from several starting models within
|
|
35
|
+
resolvable bounds, complex-step Jacobian, linearized uncertainty
|
|
36
|
+
(standard deviations, multiplicative factors, correlations, depths with
|
|
37
|
+
standard deviations), a goodness-of-fit p-value, and optional static-shift
|
|
38
|
+
factors per MN segment (`LayerFit.segment_mn2` maps them to MN/2). Each
|
|
39
|
+
start runs briefly and the best are continued until one converges, which
|
|
40
|
+
makes over-parameterized fits several times faster; a misfit that stays put
|
|
41
|
+
while the parameters drift along a ridge of equivalent models counts as
|
|
42
|
+
converged. Warnings: a poor fit (with a static-shift hint when there are
|
|
43
|
+
several MN segments, and a note that the uncertainties are then too small),
|
|
44
|
+
a fit closer than the errors imply, parameters at their search bounds (with
|
|
45
|
+
advice for each), and poorly determined parameters (uncertainty factor above
|
|
46
|
+
10). The fit with the smallest misfit over all starts is kept, and the
|
|
47
|
+
linearized covariance comes from the singular values of the weighted
|
|
48
|
+
Jacobian, so undetermined parameters get infinite uncertainty. Results are
|
|
49
|
+
`ves.LayerFit` objects, with read-only arrays.
|
|
50
|
+
- Smooth (Occam) VES inversion, `ves.invert_smooth`: many layers with
|
|
51
|
+
logarithmically growing thicknesses, the target misfit chi2 = N_d with the
|
|
52
|
+
largest regularization weight that reaches it, the error-weighted
|
|
53
|
+
sensitivity of each layer, and the Oldenburg and Li depth of investigation
|
|
54
|
+
from two reference-model inversions that aim at the same misfit (the top of
|
|
55
|
+
the unresolved zone that reaches the bottom of the model, bridging resolved
|
|
56
|
+
gaps narrower than a factor of 2 in depth, so that it is stable against
|
|
57
|
+
overshoot of the reference models and against the number of layers). When
|
|
58
|
+
chi2 = N_d cannot be reached, the
|
|
59
|
+
model fits 1.1 times the smallest misfit instead, with a warning only if
|
|
60
|
+
that misfit is improbably large. Results are `ves.SmoothFit` objects.
|
|
61
|
+
- Every result has normalized `residuals` and a readable `summary()`
|
|
62
|
+
(`ertkit.results.InversionResult`).
|
|
63
|
+
- Plotting with matplotlib (`ertkit.plot.sounding`, `ertkit.plot.layered_model`;
|
|
64
|
+
install with `pip install "ertkit[plot]"`). Wenner fits are drawn as one
|
|
65
|
+
curve, and unbounded error bars are cut at the edges of the plot.
|
|
66
|
+
- Documentation: a user guide for VES (including error-model guidance and
|
|
67
|
+
choosing the number of layers), six worked examples (few-layer inversion,
|
|
68
|
+
smooth inversion and depth of investigation, equivalence of a suppressed
|
|
69
|
+
layer, static shifts, reading CSV files, checking an installation), and a
|
|
70
|
+
verification report generated by the tests for every documentation build.
|
|
71
|
+
- A weekly cross-check of the VES forward model against pyGIMLi and SimPEG
|
|
72
|
+
(with a different Hankel filter), also run before each release.
|
|
73
|
+
- An honest-uncertainty test: over 1000 noise draws, the misfit and the
|
|
74
|
+
coverage of the linearized intervals match their theoretical values.
|
|
75
|
+
- `arrays.geometric_factor` for any four-electrode array, including remote
|
|
76
|
+
electrodes.
|
|
77
|
+
- Verification tests against the two-layer image series (contrasts from
|
|
78
|
+
1e-4 to 1e4) and the Lipschitz integral, and of the depth of investigation
|
|
79
|
+
against a detectable depth computed independently from the true model,
|
|
80
|
+
recorded in a verification report (`pytest -m verification
|
|
81
|
+
--verification-report=PATH`).
|
|
82
|
+
|
|
83
|
+
[Unreleased]: https://github.com/abdgafartunde/ertkit/compare/v0.1.0...HEAD
|
|
84
|
+
[0.1.0]: https://github.com/abdgafartunde/ertkit/releases/tag/v0.1.0
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use ertkit in your work, please cite it as below, together with the methods it implements."
|
|
3
|
+
title: "ertkit: resistivity inversion for groundwater exploration, with uncertainty and depth of investigation"
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: Tiamiyu
|
|
7
|
+
given-names: "Abd'gafar Tunde"
|
|
8
|
+
orcid: "https://orcid.org/0000-0003-1641-7196"
|
|
9
|
+
affiliation: "School of Mathematics, Jilin University"
|
|
10
|
+
version: "0.1.0"
|
|
11
|
+
date-released: "2026-10-15"
|
|
12
|
+
license: MIT
|
|
13
|
+
repository-code: "https://github.com/abdgafartunde/ertkit"
|
|
14
|
+
url: "https://abdgafartunde.github.io/ertkit/"
|
|
15
|
+
abstract: >-
|
|
16
|
+
ertkit inverts vertical electrical sounding (VES) data for groundwater
|
|
17
|
+
exploration; 2.5-D electrical resistivity tomography (ERT) follows in later
|
|
18
|
+
releases. Each result comes with a data error model and a fit to the noise
|
|
19
|
+
level, linearized parameter uncertainty, sensitivity and a depth of
|
|
20
|
+
investigation.
|
|
21
|
+
keywords:
|
|
22
|
+
- electrical resistivity tomography
|
|
23
|
+
- vertical electrical sounding
|
|
24
|
+
- groundwater
|
|
25
|
+
- inverse problems
|
|
26
|
+
- uncertainty quantification
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Contributor Covenant 3.0 Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We pledge to make our community welcoming, safe, and equitable for all.
|
|
6
|
+
|
|
7
|
+
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Encouraged Behaviors
|
|
11
|
+
|
|
12
|
+
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
|
|
13
|
+
|
|
14
|
+
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
|
|
15
|
+
|
|
16
|
+
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
|
|
17
|
+
2. Engaging **kindly and honestly** with others.
|
|
18
|
+
3. Respecting **different viewpoints** and experiences.
|
|
19
|
+
4. **Taking responsibility** for our actions and contributions.
|
|
20
|
+
5. Gracefully giving and accepting **constructive feedback**.
|
|
21
|
+
6. Committing to **repairing harm** when it occurs.
|
|
22
|
+
7. Behaving in other ways that promote and sustain the **well-being of our community**.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Restricted Behaviors
|
|
26
|
+
|
|
27
|
+
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
|
|
28
|
+
|
|
29
|
+
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
|
|
30
|
+
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
|
|
31
|
+
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
|
|
32
|
+
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
|
|
33
|
+
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
|
|
34
|
+
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
|
|
35
|
+
7. Behaving in other ways that **threaten the well-being** of our community.
|
|
36
|
+
|
|
37
|
+
### Other Restrictions
|
|
38
|
+
|
|
39
|
+
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
|
|
40
|
+
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
|
|
41
|
+
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
|
|
42
|
+
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Reporting an Issue
|
|
46
|
+
|
|
47
|
+
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
|
|
48
|
+
|
|
49
|
+
When an incident does occur, it is important to report it promptly. To report a possible violation, email the maintainer, Abd'gafar Tunde Tiamiyu, at abdgafartunde@yahoo.com. Reports are handled confidentially; if a report concerns the maintainer, you may instead contact GitHub Support.
|
|
50
|
+
|
|
51
|
+
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Addressing and Repairing Harm
|
|
55
|
+
|
|
56
|
+
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
|
|
57
|
+
|
|
58
|
+
1) Warning
|
|
59
|
+
1) Event: A violation involving a single incident or series of incidents.
|
|
60
|
+
2) Consequence: A private, written warning from the Community Moderators.
|
|
61
|
+
3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
|
|
62
|
+
2) Temporarily Limited Activities
|
|
63
|
+
1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
|
|
64
|
+
2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
|
|
65
|
+
3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
|
|
66
|
+
3) Temporary Suspension
|
|
67
|
+
1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
|
|
68
|
+
2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
|
|
69
|
+
3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
|
|
70
|
+
4) Permanent Ban
|
|
71
|
+
1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
|
|
72
|
+
2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
|
|
73
|
+
3) Repair: There is no possible repair in cases of this severity.
|
|
74
|
+
|
|
75
|
+
This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Scope
|
|
79
|
+
|
|
80
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Attribution
|
|
84
|
+
|
|
85
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
|
|
86
|
+
|
|
87
|
+
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
|
|
88
|
+
|
|
89
|
+
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Contributing to ertkit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in ertkit. Bug reports, questions, suggestions and
|
|
4
|
+
pull requests are all welcome. Everyone taking part follows the
|
|
5
|
+
[Code of Conduct](https://github.com/abdgafartunde/ertkit/blob/main/CODE_OF_CONDUCT.md).
|
|
6
|
+
|
|
7
|
+
## Support
|
|
8
|
+
|
|
9
|
+
ertkit is maintained by one researcher on a best-effort basis. Questions and
|
|
10
|
+
bug reports go to the [issue tracker](https://github.com/abdgafartunde/ertkit/issues);
|
|
11
|
+
a bug report should include the output of `ertkit.show_versions()`.
|
|
12
|
+
|
|
13
|
+
## Development setup
|
|
14
|
+
|
|
15
|
+
Install [uv](https://docs.astral.sh/uv/), then:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/abdgafartunde/ertkit.git
|
|
19
|
+
cd ertkit
|
|
20
|
+
uv sync # creates .venv with all development tools
|
|
21
|
+
uv run pre-commit install # runs the formatters and linters on commit
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Everyday commands
|
|
25
|
+
|
|
26
|
+
| Task | Command |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Tests | `uv run pytest` |
|
|
29
|
+
| Tests with coverage | `uv run pytest --cov` |
|
|
30
|
+
| Fast tests only | `uv run pytest -m "not slow"` |
|
|
31
|
+
| Lint and format | `uv run pre-commit run --all-files` |
|
|
32
|
+
| Type check | `uv run mypy` |
|
|
33
|
+
| Verification report (for the docs) | `uv run pytest -m verification --verification-report=docs/_generated/verification.json` |
|
|
34
|
+
| Documentation | `uv run sphinx-build -W --keep-going docs docs/_build/html` |
|
|
35
|
+
|
|
36
|
+
Test markers: `slow` (long tests, skipped by the oldest-dependencies job),
|
|
37
|
+
`verification` (checks that feed the verification report) and `crosscheck`
|
|
38
|
+
(comparisons with pyGIMLi and SimPEG, run weekly).
|
|
39
|
+
|
|
40
|
+
## Pull requests
|
|
41
|
+
|
|
42
|
+
One pull request per feature or fix. Each pull request:
|
|
43
|
+
|
|
44
|
+
- adds or updates tests, and states the justification for every numerical
|
|
45
|
+
tolerance next to it;
|
|
46
|
+
- updates the documentation and adds an entry under `[Unreleased]` in
|
|
47
|
+
`CHANGELOG.md`;
|
|
48
|
+
- passes all CI checks before it is merged (merges are squash merges).
|
|
49
|
+
|
|
50
|
+
Numbers in the documentation are never typed by hand: they come from the
|
|
51
|
+
example gallery, the verification report or named constants.
|
|
52
|
+
|
|
53
|
+
## Code provenance
|
|
54
|
+
|
|
55
|
+
No code is adapted from GPL-licensed projects such as ResIPy. Code adapted from
|
|
56
|
+
permissively licensed projects (for example pyGIMLi, Apache-2.0) keeps their
|
|
57
|
+
attribution. Digital filter coefficients come from libdlf, whose filter values
|
|
58
|
+
are licensed CC BY 4.0 and are attributed in the documentation.
|
|
59
|
+
|
|
60
|
+
## Use of AI tools
|
|
61
|
+
|
|
62
|
+
Development uses AI assistance: Claude Code (Anthropic) helps write code,
|
|
63
|
+
tests and documentation, and runs reviews of the mathematics, the code and the
|
|
64
|
+
documentation before releases. The maintainer makes the design decisions and
|
|
65
|
+
personally checks derivations, tolerances and the verification report before
|
|
66
|
+
each release. Each release's notes summarize the AI assistance and what was
|
|
67
|
+
checked by hand.
|
|
68
|
+
|
|
69
|
+
## Documentation deployment
|
|
70
|
+
|
|
71
|
+
The documentation is built for every pull request and push to `main`, and
|
|
72
|
+
deployed when a release is published, so the website matches the latest
|
|
73
|
+
release; a manual run of the Docs workflow redeploys it (for example after
|
|
74
|
+
adding the DOI).
|
|
75
|
+
|
|
76
|
+
## Maintainer's sign-off checklist
|
|
77
|
+
|
|
78
|
+
Before each release the maintainer checks, personally:
|
|
79
|
+
|
|
80
|
+
- the derivations behind the release's new methods, against the design
|
|
81
|
+
document and the cited papers;
|
|
82
|
+
- that every tolerance in the verification report has a sound justification;
|
|
83
|
+
- the verification report and the cross-check results of the release
|
|
84
|
+
candidate;
|
|
85
|
+
- that the examples' text matches what they print;
|
|
86
|
+
- the AI-assisted review's findings and how each was resolved.
|
|
87
|
+
|
|
88
|
+
## Release checklist
|
|
89
|
+
|
|
90
|
+
1. All CI checks pass on `main`, and the weekly cross-check workflow has been
|
|
91
|
+
run on the release candidate.
|
|
92
|
+
2. The AI-assisted review is done and the maintainer's sign-off checklist
|
|
93
|
+
above is complete.
|
|
94
|
+
3. `CHANGELOG.md`: rename `[Unreleased]` to `[X.Y.Z] - YYYY-MM-DD` and add a
|
|
95
|
+
new empty `[Unreleased]` section.
|
|
96
|
+
4. `CITATION.cff`: set `version` and `date-released`. `README.md`: update the
|
|
97
|
+
status section.
|
|
98
|
+
5. `uv run pre-commit autoupdate` has been run, unless pre-commit.ci keeps
|
|
99
|
+
the hooks current.
|
|
100
|
+
6. A development build uploaded to TestPyPI (manual run of the `Release`
|
|
101
|
+
workflow) installs and imports correctly.
|
|
102
|
+
7. Check that `.zenodo.json` is present, the Zenodo webhook is on, the PyPI
|
|
103
|
+
trusted publisher exists, and the `github-pages` environment allows tags
|
|
104
|
+
`v*`.
|
|
105
|
+
8. Create the GitHub release with tag `vX.Y.Z`; its notes summarize the AI
|
|
106
|
+
assistance and what the maintainer checked by hand. The `Release` workflow
|
|
107
|
+
checks that the tag matches `CITATION.cff` and `CHANGELOG.md`, then uploads
|
|
108
|
+
to PyPI; Zenodo archives the release and issues a DOI, and the Docs
|
|
109
|
+
workflow deploys the documentation.
|
|
110
|
+
9. After the release: add the DOI to `CITATION.cff`, the README and
|
|
111
|
+
`docs/citing.md`, then run the Docs workflow manually.
|
|
112
|
+
|
|
113
|
+
## Repository review exceptions
|
|
114
|
+
|
|
115
|
+
The repository is checked with the Scientific Python
|
|
116
|
+
[repo-review](https://learn.scientific-python.org/development/guides/repo-review/).
|
|
117
|
+
Three checks are deliberately not followed:
|
|
118
|
+
|
|
119
|
+
- **PY007 (task runner).** The uv commands above play this role; a nox or tox
|
|
120
|
+
configuration would duplicate them.
|
|
121
|
+
- **PC140 (type checker in pre-commit).** mypy runs as its own CI step from
|
|
122
|
+
the locked environment, where it sees numpy, scipy and their type stubs; in
|
|
123
|
+
pre-commit's isolated environment it would not.
|
|
124
|
+
- **PC180 (Markdown formatter).** Markdown files contain LaTeX math that
|
|
125
|
+
formatters can rewrite in ways GitHub then renders wrongly.
|
ertkit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Abd'gafar Tunde Tiamiyu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ertkit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ertkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Resistivity inversion for groundwater exploration (VES now, 2.5-D ERT planned), with uncertainty and depth of investigation.
|
|
5
|
+
Project-URL: Documentation, https://abdgafartunde.github.io/ertkit/
|
|
6
|
+
Project-URL: Source, https://github.com/abdgafartunde/ertkit
|
|
7
|
+
Project-URL: Issues, https://github.com/abdgafartunde/ertkit/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/abdgafartunde/ertkit/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Abd'gafar Tunde Tiamiyu
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: electrical resistivity tomography,geophysics,groundwater,inverse problems,uncertainty quantification,vertical electrical sounding
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.12
|
|
27
|
+
Requires-Dist: libdlf>=0.3
|
|
28
|
+
Requires-Dist: numpy>=2.0
|
|
29
|
+
Requires-Dist: scipy>=1.16
|
|
30
|
+
Provides-Extra: plot
|
|
31
|
+
Requires-Dist: matplotlib>=3.10; extra == 'plot'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# ertkit
|
|
35
|
+
|
|
36
|
+
[](https://pypi.org/project/ertkit/)
|
|
37
|
+
[](https://github.com/abdgafartunde/ertkit/actions/workflows/ci.yml)
|
|
38
|
+
[](https://abdgafartunde.github.io/ertkit/)
|
|
39
|
+
[](https://github.com/abdgafartunde/ertkit/blob/main/LICENSE)
|
|
40
|
+
|
|
41
|
+
**Resistivity imaging for groundwater exploration, with an honest account of
|
|
42
|
+
what the data can resolve.**
|
|
43
|
+
|
|
44
|
+
ertkit is a Python package for inverting vertical electrical sounding (VES)
|
|
45
|
+
data, with 2.5-D electrical resistivity tomography (ERT) to follow. Each
|
|
46
|
+
result comes with what is needed to judge it:
|
|
47
|
+
|
|
48
|
+
- a data error model, and a fit to the noise level rather than to every digit
|
|
49
|
+
of the data;
|
|
50
|
+
- sensitivity and depth of investigation, so that unresolved parts of a model
|
|
51
|
+
are marked as such;
|
|
52
|
+
- parameter uncertainty, with the range of equivalent models that fit the data
|
|
53
|
+
equally well planned for release 0.2.
|
|
54
|
+
|
|
55
|
+
## Why another resistivity code?
|
|
56
|
+
|
|
57
|
+
Boreholes are often sited from resistivity models whose reliability was never
|
|
58
|
+
quantified. Open tools such as [pyGIMLi](https://www.pygimli.org),
|
|
59
|
+
[SimPEG](https://simpeg.xyz) and [ResIPy](https://gitlab.com/hkex/resipy)
|
|
60
|
+
already provide excellent modeling and inversion. ertkit focuses on three
|
|
61
|
+
things: making reliability the default output, publishing a verification
|
|
62
|
+
report with every release, and keeping the code small enough to teach from.
|
|
63
|
+
The [design document](https://abdgafartunde.github.io/ertkit/dev/design.html)
|
|
64
|
+
gives the full statement of need, the mathematics and the verification plan.
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install ertkit # Python 3.12 or later
|
|
70
|
+
pip install "ertkit[plot]" # with plotting (matplotlib)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import numpy as np
|
|
77
|
+
import ertkit
|
|
78
|
+
from ertkit import ves
|
|
79
|
+
|
|
80
|
+
truth = ves.LayeredModel(resistivity=[150.0, 30.0, 800.0], thickness=[2.0, 15.0])
|
|
81
|
+
survey = ves.Survey.schlumberger(ab2=np.geomspace(2.5, 200.0, 22), mn2=0.5)
|
|
82
|
+
data = ves.Sounding.synthetic(truth, survey, ertkit.ErrorModel(relative=0.03), rng=5)
|
|
83
|
+
# Field data: data = ves.read_csv("sounding.csv")
|
|
84
|
+
|
|
85
|
+
fit = ves.invert_few_layer(data, n_layers=3, rng=0)
|
|
86
|
+
print(fit.summary()) # layers with uncertainty factors (x/), depths +- sd, fit
|
|
87
|
+
|
|
88
|
+
smooth = ves.invert_smooth(data)
|
|
89
|
+
print(f"depth of investigation: {smooth.doi:.0f} m")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The first `print` shows:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
LayerFit: chi2 = 16.1 for 22 data (target 17, ratio 0.947)
|
|
96
|
+
converged: True (`ftol` termination condition is satisfied.)
|
|
97
|
+
|
|
98
|
+
layer resistivity (ohm m) thickness (m) depth (m)
|
|
99
|
+
1 144.6 x/ 1.04 2.04 x/ 1.04 2.04 +- 0.075
|
|
100
|
+
2 30.18 x/ 1.03 15.2 x/ 1.05 17.3 +- 0.69
|
|
101
|
+
3 787.9 x/ 1.12 half-space
|
|
102
|
+
p-value: 0.517
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Here `x/ 1.04` means "multiplied or divided by 1.04" (one standard
|
|
106
|
+
deviation).
|
|
107
|
+
|
|
108
|
+
## Status
|
|
109
|
+
|
|
110
|
+
Release 0.1 covers vertical electrical sounding: a layered-earth forward
|
|
111
|
+
model, few-layer inversion with linearized uncertainty, smooth inversion with
|
|
112
|
+
sensitivity and a depth of investigation, CSV input and plotting. Planned
|
|
113
|
+
releases:
|
|
114
|
+
|
|
115
|
+
| Release | Content |
|
|
116
|
+
|---|---|
|
|
117
|
+
| 0.1 | VES: layered-earth forward model, few-layer and smooth inversion, linearized uncertainty, sensitivity and depth of investigation |
|
|
118
|
+
| 0.2 | VES equivalence analysis |
|
|
119
|
+
| 0.3 | 2.5-D ERT forward modeling |
|
|
120
|
+
| 0.4 | ERT inversion with an error model and cumulative sensitivity |
|
|
121
|
+
| 0.5 | ERT depth of investigation and uncertainty maps |
|
|
122
|
+
| 0.6 | Field data formats and an end-to-end field example |
|
|
123
|
+
| 1.0 | Stable public API |
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
The documentation at <https://abdgafartunde.github.io/ertkit/> has the user
|
|
128
|
+
guide, worked examples, the API reference and the
|
|
129
|
+
[verification report](https://abdgafartunde.github.io/ertkit/verification.html),
|
|
130
|
+
generated by the test suite for each release.
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
Bug reports, questions and suggestions are welcome on the
|
|
135
|
+
[issue tracker](https://github.com/abdgafartunde/ertkit/issues). To work on
|
|
136
|
+
the code, install [uv](https://docs.astral.sh/uv/) and run:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
git clone https://github.com/abdgafartunde/ertkit.git
|
|
140
|
+
cd ertkit
|
|
141
|
+
uv sync
|
|
142
|
+
uv run pytest
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
See the [contributing guide](https://github.com/abdgafartunde/ertkit/blob/main/CONTRIBUTING.md)
|
|
146
|
+
and the [Code of Conduct](https://github.com/abdgafartunde/ertkit/blob/main/CODE_OF_CONDUCT.md).
|
|
147
|
+
|
|
148
|
+
## Citing
|
|
149
|
+
|
|
150
|
+
Each release is archived on Zenodo with a DOI. Citation metadata are in
|
|
151
|
+
[CITATION.cff](https://github.com/abdgafartunde/ertkit/blob/main/CITATION.cff);
|
|
152
|
+
please also cite the methods ertkit implements.
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT; see [LICENSE](https://github.com/abdgafartunde/ertkit/blob/main/LICENSE).
|