Skip to main content

A package for KD-tree optimized inverse distance weighting interpolation.

Project description

treeIDW

treeIDW is a Python library for performing Inverse Distance Weighting (IDW) interpolation using an efficient KD-tree-based selection strategy.
It is designed to be easy to use for newcomers while offering fine-grained control and performance-oriented options for advanced users in numerical methods and spatial data analysis.


Key Features

  • Efficient IDW interpolation using KD-tree nearest-neighbor selection
  • Automatic exclusion of boundary nodes with negligible contribution
  • Optimized numerical kernels powered by numba
  • Scalable to large datasets (millions of interpolation points)
  • Simple API with expert-level tunable parameters

Installation

treeIDW is available on PyPI.

pip install treeIDW

Development installation (from source)

git clone https://github.com/Dorian210/treeIDW
cd treeIDW
pip install -e .

Dependencies

The core dependencies are:

  • numpy
  • scipy
  • numba

These are automatically installed when using pip.


Package Structure

  • treeIDW.treeIDW
    Core IDW interpolation engine.
    Uses a KD-tree to select only boundary nodes with significant influence, improving both accuracy and performance.

  • treeIDW.helper_functions
    Low-level, performance-critical routines for IDW weight computation.
    Implemented with numba, including vectorized and parallelized variants.

  • treeIDW.weight_function
    Definition of the IDW weight function.
    The default implementation uses inverse squared distance, but custom weight laws can be implemented if needed.


Examples

Example scripts are provided in the examples/ directory:

  • Graphical demonstration
    Interpolation of a rotating vector field inside a square domain.

  • Large-scale computation
    Propagation of a scalar field from 1,000 boundary nodes to 1,000,000 internal points, highlighting scalability.

  • Logo generation
    The generation process of the treeIDW logo itself, where the letters “IDW” are encoded as a vector field and interpolated on a 2D grid.


Documentation


Contributions

This project is currently not open to active development contributions.
However, bug reports and suggestions are welcome via the issue tracker.


License

This project is distributed under the CeCILL License.
See LICENSE.txt for details.

Project details


Download files

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

Source Distribution

treeidw-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

treeidw-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file treeidw-1.0.0.tar.gz.

File metadata

  • Download URL: treeidw-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for treeidw-1.0.0.tar.gz
Algorithm Hash digest
SHA256 af2d790f8dc9894e3ac9a5cf2f71d3d1c459448c4a23fd112a95fc0d50640202
MD5 b77a5e93711a4b10ee1d13e2b20c1dc9
BLAKE2b-256 63e99339570d173a84476d97ff4c5ebc37070c55f7d7171b29293cdaa0cefdbf

See more details on using hashes here.

File details

Details for the file treeidw-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: treeidw-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for treeidw-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1888de3a79b732ba0be14d8663c6e60be032b4d5e952f9f5503660edfba89009
MD5 d7a8fa4b0f512cd839a7be7cffa50f5f
BLAKE2b-256 5e401c64b26fba90019fb96a55a4e8504973995485210a40bbb2df6113b0f58a

See more details on using hashes here.

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