Skip to main content

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

Full documentation →


Installation

conda / mamba (recommended)

mamba env create -f environment.yml
mamba activate krigekit

pip

pip install -e ".[dev]"   # after compiling the Fortran library

Compile the Fortran library first:

python build_lib.py                    # Linux/macOS (gfortran)
python build_lib.py --compiler ifx     # Windows (Intel ifx)

See docs/installation.md for full details including debug builds, --no-openmp, and docs dependencies.


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 environment
└── pyproject.toml       pip package configuration

Contributing

  1. Fork the repository and create a feature branch.
  2. Add tests for any new behaviour.
  3. Run pytest to confirm all tests pass.
  4. Open a pull request.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

krigekit-0.2.0-py3-none-win_amd64.whl (756.5 kB view details)

Uploaded Python 3Windows x86-64

krigekit-0.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

krigekit-0.2.0-py3-none-macosx_15_0_x86_64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

krigekit-0.2.0-py3-none-macosx_14_0_arm64.whl (1.2 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file krigekit-0.2.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: krigekit-0.2.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 756.5 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for krigekit-0.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3e1e1e18e7e42a43d46844147126d64430a0f7961191d3003d52aad27a0e91af
MD5 878712fa3423b8fcd8065b75a1816dd2
BLAKE2b-256 5416d5dfeb3501ee91f93ef94b73810554ef21e1db60e49f91df1db3f493ed83

See more details on using hashes here.

Provenance

The following attestation bundles were made for krigekit-0.2.0-py3-none-win_amd64.whl:

Publisher: build_wheels.yml on ougx/krigekit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file krigekit-0.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for krigekit-0.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2ab919ce37a14b1af7464620ce68d4d8379459ff90a07f824963ea8bd022f197
MD5 87976a6289eaec0beb8077ea806878f0
BLAKE2b-256 6def73a107c74a6c6f8b4427ff8097b1b0773ecc41a339f45a76f63cb0729fa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for krigekit-0.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on ougx/krigekit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file krigekit-0.2.0-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for krigekit-0.2.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 572643828db47ae59a4154722d2c5b29f3c61209858582ac1b540bf588d7c5d9
MD5 c28fcbf28dcb2c6dfa9dc9e154ce35de
BLAKE2b-256 3cca3d1ddb035efbdaa7d6f37fe6382fe3638df6b566a238b7d8669663b0a699

See more details on using hashes here.

Provenance

The following attestation bundles were made for krigekit-0.2.0-py3-none-macosx_15_0_x86_64.whl:

Publisher: build_wheels.yml on ougx/krigekit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file krigekit-0.2.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for krigekit-0.2.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bf40a0b9de820308ec588d4ddbd6dee3c1ce9e0370c68111f1d215e07c74567d
MD5 ce1b94b5aa68b53bfb321f093e1e2e68
BLAKE2b-256 e4d60d3bcbd4eba7464e2c57cd1e5c970711afcc7b52a3b87e660623851e9d20

See more details on using hashes here.

Provenance

The following attestation bundles were made for krigekit-0.2.0-py3-none-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on ougx/krigekit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page