$ show gimli-org/pyGIMLi
pyGIMLi is a mature open-source geophysical modelling and inversion library, implemented as a C++ core with Python bindings. It provides mesh generation, finite-element solvers, data containers, and high-level manager classes for methods such as electrical resistivity tomography (ERT), vertical electrical sounding (VES), frequency-domain electromagnetics (FDEM), magnetics, gravity, traveltime, and spectral induced polarization. The library is not a GUI application; it is a programmatic toolkit with Python entry points, example scripts, and a console-app pattern in some managers.
The LLM identified 6 files worth highlighting for reuse:
Header-only C++ block-matrix abstraction for coupled or structured linear systems. Demonstrates a reusable pattern for assembling and solving multi-physics or multi-dataset problems with sparse blocks, and is self-contained enough to extract into a new C++ project.
General-purpose array utilities including unique-row operations, progress bars, and small data helpers. These functions are decoupled from the inversion core and can be lifted into any scientific Python project with minimal modification.
Provides pygimli.test() and doctest/pytest integration for scientific code. Encapsulates a pattern for running a library's test suite programmatically, which is useful for validating numerical code in CI or in user environments.
High-level mesh generation and manipulation toolkit for unstructured 2D/3D meshes. Encapsulates mesh creation, refinement, and boundary handling in a way that could be reused as a standalone meshing layer outside pyGIMLi.
The FDEM class bundles data import, frequency selection, forward modelling, and plotting for frequency-domain electromagnetic problems. It is a clean example of a method-specific manager pattern for geophysical workflows.
The Timelapse class handles multi-dataset inversion with time selection and batch result handling. It demonstrates a reusable pattern for time-lapse geophysical monitoring and can be adapted to other inversion backends.