curlew
A toolkit for building 2- and 3- dimensional geological models using neural fields.
This approach allows the inclusion of diverse geological data, while the overarching graph-based modelling framework allows complex structures (unconformities, folds, faults, intrusions, etc.) to be constructed sequentially based on a geological history.
As well interpolation-based 3D modelling, curlew can build complex synthetic geology models in which the neural fields are replaced by simple mathematical functions. These synthetic models can then be sampled to create datasets for testing, benchmarking and algorithm development.
Everything is implemented in a differentiable way using pytorch to facilitate inversion frameworks and perform optimisation tasks.
Getting started
Installation
To install directly from github try:
pip install git+https://github.com/samthiele/curlew.git
This should run on most systems: numpy, pytorch and tqdm are the only required dependencies. Other recommended (but optional) dependencies include matplotlib (for 2D plotting), plyfile(for IO with 3D PLY files), and napari (for 3D visualisation).
To install all dependencies, including the optional ones, use:
pip install curlew[all]
Tutorials
Quickly get up to speed with curlew using these CoLab tutorials.
Documentation
Documentation is built and served through GitHub Pages:
- Stable (
main) — more stable API version - Development (
dev) — latest changes on the dev branch
Support and feedback
Please use GitHub issues to report bugs. For broader ideas or questions, don't hesitate to use the discussions page.
Contributing and appreciation
Please star this repository if you found it useful. If you have fixed bugs or added new features then we welcome pull requests.
Authors and acknowledgment
curlew has been developed by Sam Thiele and Akshay Kamath, with valuable input from Mike Hillier, Lachlan Grose, Richard Gloaguen and Florian Wellmann.
If you use curlew we would appreciate it if you:
- Cite the following paper (for academic work)
Kamath, A. V., Thiele, S. T., Moulard, M., Grose, L., Tolosana-Delgado, R., Hillier, M., and Gloaguen, R. (2026). Curlew 1.0: Spatio-temporal implicit geological modelling with neural fields in python. Solid Earth. doi:10.31223/X5KX81
- Star this repository so that we get a rough idea of our user base ⭐
Versions and change log
v1.20 - another significant refactoring (sorry)
-
Renamed
GeoFieldtoGeoEventto avoid confusion with scalar fields themselves (inheriting fromBaseSF). UpdatedGeoEventso that they can contain multiple separate underlying fields and (using these) definevolumeswithin the model. These volumes can be used to e.g., define finite faults. -
Updated the
Overprintclass to allow onlap relationships in which the unconformity geometry is determined by the older (rather than the younger) implicit field. -
Simplified synthetic model creation so that extracted constraints are added directly to the created
BaseSFinstances, and added 2D and 3D options so that 3D test data can be more easily generated. -
Added the
Pebbleclass (inspired byGeode) to help more easily create, track and combine losses and their associated optimsers. -
Added option for custom losses to be defined at the
GeoModellevel, to enable workflows that optimise all fields as a stack (e.g., fitting to large datasets that cannot easily be broken down to the per-field level [ e.g., gravity inversion ]). -
Added Learnable Diffeomorphic Interpolation (
restore). Folded stratigraphy is a reference layer-cake carried by a learned diffeomorphism, so its topology is preserved by construction rather than by a penalty. The velocity is an Euler field and so divergence-free. It can be stepped with RK4, or built by composing exact shears, which stays volume-preserving at any amplitude. Contacts, bedding normals, and finite-strain markers all constrain that one map. The Fourier wavelength band is read from the data (spectral_band): hinge spacing and limb spacing, widened to at least two octaves and the diameter of the observations. -
Faulted folds can be restored with a sheet lift (
FaultLift); a true discontinuity still needs its own event. A pin fixes the restored frame after fitting. Optional priors cover orthogonal thickness, layer-parallel stretch, and Hencky strain. -
Moved geometry helpers out of
curlew/geometry.pyintocurlew/geometry/. Documentation is published for bothmainanddev. -
Added a
quadraticdecay toEllipsoidalField(r²: 0 at the centre, 1 on the unit ellipse).
v1.1 - major restructure, introduced napari-based 3D viewer
Upgrades to the geology/modeling core, especially an improved structure for the GeoField class and associated deformation events. Added new field types, including Fourier series fields, which tend to converge faster and better than Fourier neural fields. Also included a prototype napari-based 3D visualization tool that runs nicely in parallel to jupyter notebook environments.
v1.0 - initial release
- Leave a GitHub issue if you have questions or comments (Issues do not strictly need to be related to bug reports).
Metadata
Release files for curlew 1.20
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 |
|---|---|---|---|---|
| curlew-1.20.tar.gz | 276.3 kB | Without provenance | Details for curlew-1.20.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curlew-1.20-py3-none-any.whl | Python 3 | none | any | Details for curlew-1.20-py3-none-any.whl |
Total release size: 527.2 kB
Release files / curlew-1.20.tar.gz
| Download URL | curlew-1.20.tar.gz |
|---|---|
| Size | 276.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d783cb0ccc8713ddbd763d1112c993663b92d3c597209c1ecb882de0115379d0
|
|
BLAKE2b-256 checksum How to use checksums |
6f13fa228b3e80abe6a1c92ef25b4565a2051ce6a6971107894b932237759a74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / curlew-1.20-py3-none-any.whl
| Download URL | curlew-1.20-py3-none-any.whl |
|---|---|
| Size | 250.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
472612ca95df3a38bc51ca6c1cedcf48937c0cb38b6cdfb1941dd8154fbd6f62
|
|
BLAKE2b-256 checksum How to use checksums |
48627e978bd42963ae73e6e9c0d04ede247a45795e68a6c46ae32c964c56e9a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for curlew 1.20
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.