Python wrapper for a Fortran kriging and sequential Gaussian simulation engine
Project description
krigekit
A Python wrapper for a high-performance Fortran kriging engine parallelised with OpenMP.
| Capability | Notes |
|---|---|
| Ordinary and simple kriging | Point and block support |
| Co-kriging | Linear Model of Coregionalisation |
| Universal kriging / KED | External drift variables |
| Sequential Gaussian Simulation | Reproducible paths, multi-realisation |
| Space-time kriging | Sum-metric and product-sum ST models |
| Multiple Indicator Kriging / SIS | Categorical variables, three cross-variogram strategies |
| Spatially Varying Anisotropy | Per-block variogram |
| Cross-validation | Leave-one-out |
| Kriging weight reuse | Store and replay weights |
Installation
pip
pip install krigekit
Pre-built binary wheels are available for:
| Platform | Architecture | Minimum OS |
|---|---|---|
| Linux | x86_64 | manylinux_2_28 (RHEL 8 / Ubuntu 20.04 equivalent) |
| macOS | arm64 (Apple Silicon) | macOS 14 Sonoma |
| macOS | x86_64 (Intel) | macOS 15 Sequoia |
| Windows | x86_64 | Windows 10 / Server 2019 |
Requires Python 3.10, 3.11, or 3.12.
conda / mamba
conda-forge packaging is planned. In the meantime, install via pip inside a conda environment:
conda create -n krigekit python=3.12
conda activate krigekit
pip install krigekit
Quick start
import numpy as np
from krigekit import Kriging
obs_coord = np.array([[0,0],[1,0],[0,1],[1,1],[0.5,0.5]], dtype=float)
obs_value = np.array([1.0, 2.0, 3.0, 4.0, 2.5])
grid_coord = np.mgrid[0:1.1:0.25, 0:1.1:0.25].reshape(2,-1).T
k = Kriging()
k.set_obs(ivar=1, coord=obs_coord, value=obs_value)
k.set_grid(coord=grid_coord)
k.set_vgm(ivar=1, jvar=1, vtype="sph", sill=1.0, a_major=1.0)
k.set_search()
k.solve()
df = k.get_result_df()
del k
For the full class API, co-kriging, SGSIM, space-time kriging, indicator simulation, and more, see the user guide and gallery examples.
Repository structure
krigekit/
├── src/
│ ├── libkriging/ Fortran kriging engine
│ ├── sparks/ Pilot-point kriging/SGSIM CLI
│ └── krigekit/ Python ctypes wrapper
├── examples/ Sphinx-Gallery example scripts
├── tests/ pytest test suite
├── test_data/ CSV/image data used by tests and examples
├── docs/ Sphinx documentation source
├── build_lib.py Fortran compile script
├── environment.yml conda/mamba development environment
└── pyproject.toml pip package configuration
Contributing
Building from source
A Fortran compiler is required (gfortran ≥ 10 or Intel ifx/ifort).
# Clone and set up the development environment
git clone https://github.com/ougx/krigekit.git
cd krigekit
# Compile the Fortran library
python build_lib.py --compiler gfortran # Linux / macOS
python build_lib.py --compiler gfortran # Windows (MinGW via MSYS2)
python build_lib.py --compiler ifx # Windows (Intel oneAPI)
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
Additional build options:
python build_lib.py --opt debug # debug build, no optimisation
python build_lib.py --no-openmp # disable OpenMP
python build_lib.py --hcache 0 # disable factor cache
Workflow
- Fork the repository and create a feature branch.
- Add tests for any new behaviour.
- Run
pytestto confirm all tests pass. - Open a pull request.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krigekit-0.2.1-py3-none-win_amd64.whl.
File metadata
- Download URL: krigekit-0.2.1-py3-none-win_amd64.whl
- Upload date:
- Size: 757.0 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32ab7ab936d48eec12d66f5ae137abacabd01267e246e323c061714fa2c91e7a
|
|
| MD5 |
5abde857d743fe63ffcd27fa1aec7bfc
|
|
| BLAKE2b-256 |
67d2275e6aee5fafda4bb0895e8b4f6463bb7ae52b2831ab852793064ed780e4
|
Provenance
The following attestation bundles were made for krigekit-0.2.1-py3-none-win_amd64.whl:
Publisher:
build_wheels.yml on ougx/krigekit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krigekit-0.2.1-py3-none-win_amd64.whl -
Subject digest:
32ab7ab936d48eec12d66f5ae137abacabd01267e246e323c061714fa2c91e7a - Sigstore transparency entry: 1799631898
- Sigstore integration time:
-
Permalink:
ougx/krigekit@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ougx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_wheels.yml@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file krigekit-0.2.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: krigekit-0.2.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0b5ad2826e52eb3f645641b03a52e2aa8eb525d97330ed93a042b56cd52b7bd
|
|
| MD5 |
abd14354adf144e7d5ec37a10000b7a6
|
|
| BLAKE2b-256 |
e621762c22c275a7ba90deeec54888059828bccf7ef92e1285f8f811852f428e
|
Provenance
The following attestation bundles were made for krigekit-0.2.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
build_wheels.yml on ougx/krigekit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krigekit-0.2.1-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
b0b5ad2826e52eb3f645641b03a52e2aa8eb525d97330ed93a042b56cd52b7bd - Sigstore transparency entry: 1799632392
- Sigstore integration time:
-
Permalink:
ougx/krigekit@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ougx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_wheels.yml@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file krigekit-0.2.1-py3-none-macosx_15_0_x86_64.whl.
File metadata
- Download URL: krigekit-0.2.1-py3-none-macosx_15_0_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c1f42c7b24302ea39ab4dada42c857feac744f9a205a64dcb5948576c0b7d5
|
|
| MD5 |
7a7384027f897b2d0f20a4f22e1c8f6f
|
|
| BLAKE2b-256 |
ab7e08b8e0b4036502da637811f11e390d8f31034ad5c6f1a0008c471bed1917
|
Provenance
The following attestation bundles were made for krigekit-0.2.1-py3-none-macosx_15_0_x86_64.whl:
Publisher:
build_wheels.yml on ougx/krigekit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krigekit-0.2.1-py3-none-macosx_15_0_x86_64.whl -
Subject digest:
e1c1f42c7b24302ea39ab4dada42c857feac744f9a205a64dcb5948576c0b7d5 - Sigstore transparency entry: 1799632168
- Sigstore integration time:
-
Permalink:
ougx/krigekit@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ougx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_wheels.yml@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file krigekit-0.2.1-py3-none-macosx_14_0_arm64.whl.
File metadata
- Download URL: krigekit-0.2.1-py3-none-macosx_14_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
705c58076ee9202053fbe5b0aa0327f93e9afabeb36a6b934843c45bb9433fcc
|
|
| MD5 |
39a6ee1f27634390a8bf82bc9a15e0e9
|
|
| BLAKE2b-256 |
affca500e31a377eb7494796fb4c70ebb25bb5f07438b0fe511bc99105bea63a
|
Provenance
The following attestation bundles were made for krigekit-0.2.1-py3-none-macosx_14_0_arm64.whl:
Publisher:
build_wheels.yml on ougx/krigekit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
krigekit-0.2.1-py3-none-macosx_14_0_arm64.whl -
Subject digest:
705c58076ee9202053fbe5b0aa0327f93e9afabeb36a6b934843c45bb9433fcc - Sigstore transparency entry: 1799632037
- Sigstore integration time:
-
Permalink:
ougx/krigekit@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ougx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_wheels.yml@146fd754f73fb696b49f824cfb98a2dd8f6c3d81 -
Trigger Event:
push
-
Statement type: