Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterpolate/core/data_models/point_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterpolate/core/data_models/poisson_kriging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
6 changes: 3 additions & 3 deletions src/pyinterpolate/core/pipelines/block_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down Expand Up @@ -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']
... )
Expand Down Expand Up @@ -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']
... )
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterpolate/distance/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterpolate/idw/idw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down Expand Up @@ -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']
... )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
... )
Expand Down