From 1165df7c7d53abcecdbbd001fe34fed22136d43d Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Fri, 16 Oct 2026 14:59:04 +0800 Subject: [PATCH] docs: fix current API keywords in usage examples --- README.md | 14 +++++--------- .../core/data_models/centroid_poisson_kriging.py | 2 +- .../core/data_models/point_support.py | 2 +- .../core/data_models/point_support_distances.py | 2 +- .../core/data_models/poisson_kriging.py | 2 +- src/pyinterpolate/core/pipelines/block_filter.py | 6 +++--- src/pyinterpolate/distance/block.py | 2 +- src/pyinterpolate/idw/idw.py | 2 +- .../kriging/block/area_to_area_poisson_kriging.py | 2 +- .../kriging/block/area_to_point_poisson_kriging.py | 2 +- .../block/centroid_based_poisson_kriging.py | 2 +- .../deconvolution/aggregated_variogram.py | 4 ++-- .../semivariogram/deconvolution/regularize.py | 2 +- 13 files changed, 20 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index b46785bb..9a7f0a93 100644 --- a/README.md +++ b/README.md @@ -116,18 +116,14 @@ from pyinterpolate import ordinary_kriging unknown_point = (20000, 65000) prediction = ordinary_kriging(theoretical_model=semivar, known_locations=point_data, - unknown_location=unknown_point, + unknown_locations=unknown_point, no_neighbors=32) ``` **[5.]** Analyze error and uncertainty of predictions. ```python -print(prediction) # [predicted, variance error, lon, lat] -``` - -```bash ->> [211.23, 0.89, 20000, 60000] +print(prediction[0]) # [predicted, variance error, lon, lat] ``` With Pyinterpolate you can analyze and transform aggregated data. Here is the example of spatial disaggregation of areal data into point support using Poisson Kriging: @@ -145,7 +141,7 @@ Setup with *conda*: `conda install -c conda-forge pyinterpolate` Setup with *pip*: `pip install pyinterpolate` -Detailed instructions on how to install the package are presented in the file [SETUP.md](https://github.com/DataverseLabs/pyinterpolate/blob/main/SETUP.md). We pointed out there most common problems related to third-party packages. +The package dependencies are listed in [pyproject.toml](https://github.com/DataverseLabs/pyinterpolate/blob/main/pyproject.toml). You may follow those setup steps to create a *conda* environment with the package for your work: @@ -177,7 +173,7 @@ A world of advice, you should **always** use Virtual Environment for the install ## Tests and contribution -All tests are grouped in the `test` directory. If you would like to contribute, then you won't avoid testing, but it is described step-by-step here: [CONTRIBUTING.md](https://github.com/DataverseLabs/pyinterpolate/blob/main/CONTRIBUTING.md) +All tests are grouped in the `tests` directory. If you would like to contribute, then you won't avoid testing, but it is described step-by-step here: [CONTRIBUTING.md](https://github.com/DataverseLabs/pyinterpolate/blob/main/CONTRIBUTING.md) ## Use cases @@ -213,7 +209,7 @@ Core requirements and dependencies are: * scipy * tqdm -You may check a specific version of requirements in the `setup.cfg` file. Required packages versions are updated in a regular interval. +The package dependencies are declared in `pyproject.toml`. ## Package structure diff --git a/src/pyinterpolate/core/data_models/centroid_poisson_kriging.py b/src/pyinterpolate/core/data_models/centroid_poisson_kriging.py index dff7acf6..5c0633f2 100644 --- a/src/pyinterpolate/core/data_models/centroid_poisson_kriging.py +++ b/src/pyinterpolate/core/data_models/centroid_poisson_kriging.py @@ -161,7 +161,7 @@ class CentroidPoissonKrigingInput: >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/core/data_models/point_support.py b/src/pyinterpolate/core/data_models/point_support.py index e4b06a3e..e3437a6e 100644 --- a/src/pyinterpolate/core/data_models/point_support.py +++ b/src/pyinterpolate/core/data_models/point_support.py @@ -142,7 +142,7 @@ class PointSupport: >>> >>> ps = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/core/data_models/point_support_distances.py b/src/pyinterpolate/core/data_models/point_support_distances.py index 761cd7d4..0a3ba7ca 100644 --- a/src/pyinterpolate/core/data_models/point_support_distances.py +++ b/src/pyinterpolate/core/data_models/point_support_distances.py @@ -95,7 +95,7 @@ class PointSupportDistance: >>> >>> ps = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/core/data_models/poisson_kriging.py b/src/pyinterpolate/core/data_models/poisson_kriging.py index bc9dfff9..fa42f1df 100644 --- a/src/pyinterpolate/core/data_models/poisson_kriging.py +++ b/src/pyinterpolate/core/data_models/poisson_kriging.py @@ -181,7 +181,7 @@ class PoissonKrigingInput: >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/core/pipelines/block_filter.py b/src/pyinterpolate/core/pipelines/block_filter.py index af7ba3fa..31654be5 100644 --- a/src/pyinterpolate/core/pipelines/block_filter.py +++ b/src/pyinterpolate/core/pipelines/block_filter.py @@ -115,7 +115,7 @@ def filter_blocks(semivariogram_model: TheoreticalVariogram, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) @@ -239,7 +239,7 @@ def smooth_blocks(semivariogram_model: TheoreticalVariogram, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) @@ -369,7 +369,7 @@ class BlockPoissonKriging: >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/distance/block.py b/src/pyinterpolate/distance/block.py index a73f154e..345789e3 100644 --- a/src/pyinterpolate/distance/block.py +++ b/src/pyinterpolate/distance/block.py @@ -253,7 +253,7 @@ def calc_block_to_block_distance( >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/idw/idw.py b/src/pyinterpolate/idw/idw.py index 29b47573..662c54ba 100644 --- a/src/pyinterpolate/idw/idw.py +++ b/src/pyinterpolate/idw/idw.py @@ -86,7 +86,7 @@ def inverse_distance_weighting(unknown_location: ArrayLike, ... [11, 9, 7] ... ]) >>> pred = inverse_distance_weighting( - ... unknown_locations=unknown_pos, + ... unknown_location=unknown_pos, ... known_values=locs[:, -1], ... known_geometries=locs[:, :-1], ... no_neighbors=2 diff --git a/src/pyinterpolate/kriging/block/area_to_area_poisson_kriging.py b/src/pyinterpolate/kriging/block/area_to_area_poisson_kriging.py index fbdfef4b..41ee873d 100644 --- a/src/pyinterpolate/kriging/block/area_to_area_poisson_kriging.py +++ b/src/pyinterpolate/kriging/block/area_to_area_poisson_kriging.py @@ -104,7 +104,7 @@ def area_to_area_pk(semivariogram_model: TheoreticalVariogram, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/kriging/block/area_to_point_poisson_kriging.py b/src/pyinterpolate/kriging/block/area_to_point_poisson_kriging.py index cecdf2a2..ee63bd47 100644 --- a/src/pyinterpolate/kriging/block/area_to_point_poisson_kriging.py +++ b/src/pyinterpolate/kriging/block/area_to_point_poisson_kriging.py @@ -110,7 +110,7 @@ def area_to_point_pk(semivariogram_model: TheoreticalVariogram, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/kriging/block/centroid_based_poisson_kriging.py b/src/pyinterpolate/kriging/block/centroid_based_poisson_kriging.py index 6c4ddec5..c5f14997 100644 --- a/src/pyinterpolate/kriging/block/centroid_based_poisson_kriging.py +++ b/src/pyinterpolate/kriging/block/centroid_based_poisson_kriging.py @@ -114,7 +114,7 @@ def centroid_poisson_kriging(semivariogram_model: TheoreticalVariogram, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/semivariogram/deconvolution/aggregated_variogram.py b/src/pyinterpolate/semivariogram/deconvolution/aggregated_variogram.py index e01a61b0..08c7b56e 100644 --- a/src/pyinterpolate/semivariogram/deconvolution/aggregated_variogram.py +++ b/src/pyinterpolate/semivariogram/deconvolution/aggregated_variogram.py @@ -213,7 +213,7 @@ class AggregatedVariogram: >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) @@ -764,7 +764,7 @@ def regularize(blocks: Blocks, >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... ) diff --git a/src/pyinterpolate/semivariogram/deconvolution/regularize.py b/src/pyinterpolate/semivariogram/deconvolution/regularize.py index daf8783d..e5d54717 100644 --- a/src/pyinterpolate/semivariogram/deconvolution/regularize.py +++ b/src/pyinterpolate/semivariogram/deconvolution/regularize.py @@ -156,7 +156,7 @@ class Deconvolution: >>> >>> PS = PointSupport( ... points=POINT_SUPPORT_DATA['ps'], - ... ps_blocks=BLOCKS, + ... blocks=BLOCKS, ... points_value_column=POINT_SUPPORT_DATA['value_column_name'], ... points_geometry_column=POINT_SUPPORT_DATA['geometry_column_name'] ... )