Skip to content

Commit

Permalink
Merge pull request #197 from DataverseLabs/main-neighbors-selection
Browse files Browse the repository at this point in the history
V0.2.4
  • Loading branch information
Simon authored Dec 11, 2021
2 parents de4a359 + c2907a3 commit 56ae18c
Show file tree
Hide file tree
Showing 230 changed files with 5,361 additions and 3,868 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.3.post1'
__version__ = '0.2.4'
9 changes: 6 additions & 3 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ PyInterpolate is designed as the Python library for geostatistics. It's role is
Changes by date
===============

2021-XX-XX
2021-12-11
----------

**version 0.2.XX**
**version 0.2.4**

* `self.points_values` chenged to `self.points_array` in `TheoreticalSemivariogram` class,
* `NaN` values are tested and checked in `calc_semivariance_from_pt_cloud()` function,
* new semivariogram models included in the package: **cubic**, **circular**, **power**,

* corrected calculation of the closest neighbors for kriging interpolation,
* changed `prepare_kriging_data()` function,
* the new optional parameter `check_coordinates` (**bool**) of `calc_point_to_point_distance()` function to control the coordinates uniqueness tests. This test is very resource-consuming and should be avoided in a normal work and it should be performed before data injection into the modeling pipeline.
* the new `dev/profiling/` directory to test and profile parts of a code.

2021-08-23
----------
Expand Down
Binary file modified docs/build/doctrees/algorithms.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/distance.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/idw.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/io_ops.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/kriging.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/misc.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/semivariance.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/transform.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/code_documentation/viz.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/contribution.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/introduction.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/license.doctree
Binary file not shown.
13 changes: 8 additions & 5 deletions docs/build/doctrees/nbsphinx/code_documentation/distance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@
"```python\n",
"pyinterpolate.distance.calc_point_to_point_distance(\n",
" points_a,\n",
" points_b=None)\n",
" points_b=None,\n",
" check_coordinates=False\n",
")\n",
"```\n",
"\n",
"Function calculates distances between all points in the given array.\n",
"\n",
"INPUT:\n",
"\n",
"- **points_a**: (_numpy array_) points coordinates,\n",
"- **points_b**: (_numpy array_) points coordinates, default is `None`. If `None` is given then distances between all points within `points_a` is calculated.\n",
"- **points_b**: (_numpy array_) points coordinates, default is `None`. If `None` is given then distances between all points within `points_a` is calculated,\n",
"- **check_coordinates**: (_bool_) checks if coordinates are unique within a given array. It is a resource-consuming process and it should be invoked with caution, especially for large datasets.\n",
"\n",
"OUTPUT:\n",
"\n",
Expand All @@ -54,7 +57,7 @@
"pyinterpolate.distance.calc_block_to_block_distance(areas)\n",
"```\n",
"\n",
"Function calculates distances between blocks based on the population points within the block.\n",
"Function calculates distances between all given blocks.\n",
"\n",
"INPUT:\n",
"\n",
Expand Down Expand Up @@ -94,7 +97,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -108,7 +111,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.7.12"
}
},
"nbformat": 4,
Expand Down
27 changes: 21 additions & 6 deletions docs/build/doctrees/nbsphinx/code_documentation/kriging.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@
"```python\n",
"Krige.ordinary_kriging(self,\n",
" unknown_location,\n",
" number_of_neighbours,\n",
" neighbors_range=None,\n",
" min_no_neighbors=1,\n",
" max_no_neighbors=256,\n",
" test_anomalies=True)\n",
"```\n",
"\n",
Expand All @@ -278,7 +280,9 @@
"INPUT:\n",
"\n",
"- **unknown_location**: (_tuple_) position of unknown location,\n",
"- **number_of_neighbours**: (_int_) number of the closest locations to the unknown position which should be included in the modeling,\n",
"- **neighbors_range**: (_float_) distance for each neighbors are affecting the interpolated point, if not given then it is set to the semivariogram range,\n",
"- **min_no_neighbors**: (int) minimum number of neighbors used for interpolation if there is not any neighbor within the range specified by neighbors_range,\n",
"- **max_no_neighbors**: (_int_) maximum number of n-closest neighbors used for interpolation if there are too many neighbors in range. It speeds up calculations for large datasets and affects final prediction error.\n",
"- **test_anomalies**: (_bool_) check if weights are negative.\n",
"\n",
"OUTPUT:\n",
Expand All @@ -301,8 +305,10 @@
"```python\n",
"Krige.simple_kriging(self,\n",
" unknown_location,\n",
" number_of_neighbours,\n",
" global_mean,\n",
" neighbors_range=None,\n",
" min_no_neighbors=1,\n",
" max_no_neighbors=256,\n",
" test_anomalies=True)\n",
"```\n",
"\n",
Expand All @@ -311,8 +317,10 @@
"INPUT:\n",
"\n",
"- **unknown_location**: (_tuple_) position of unknown location,\n",
"- **number_of_neighbours**: (_int_) number of the closest locations to the unknown position which should be included in the modeling,\n",
"- **global_mean**: (_float_) global mean which should be known before processing,\n",
"- **neighbors_range**: (_float_) distance for each neighbors are affecting the interpolated point, if not given then it is set to the semivariogram range,\n",
"- **min_no_neighbors**: (int) minimum number of neighbors used for interpolation if there is not any neighbor within the range specified by neighbors_range,\n",
"- **max_no_neighbors**: (_int_) maximum number of n-closest neighbors used for interpolation if there are too many neighbors in range. It speeds up calculations for large datasets and affects final prediction error.\n",
"- **test_anomalies**: (_bool_) check if weights are negative.\n",
"\n",
"OUTPUT:\n",
Expand All @@ -328,11 +336,18 @@
"]\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -346,7 +361,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@
" - gaussian_model(distance, nugget, sill, semivar_range)\n",
" - exponential_model(distance, nugget, sill, semivar_range)\n",
" - linear_model(distance, nugget, sill, semivar_range)\n",
" - cubic_model(distance, nugget, sill, semivar_range)\n",
" - circular_model(distance, nugget, sill, semivar_range)\n",
" - power_model(distance, nugget, sill, semivar_range)\n",
"\n",
"\n",
"INITIALIZATION PARAMS:\n",
Expand Down Expand Up @@ -846,7 +849,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.7.12"
}
},
"nbformat": 4,
Expand Down
16 changes: 9 additions & 7 deletions docs/build/doctrees/nbsphinx/code_documentation/transform.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
Expand Down Expand Up @@ -93,7 +92,6 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
Expand All @@ -105,7 +103,6 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
Expand Down Expand Up @@ -147,7 +144,10 @@
"pyinterpolate.transform.prepare_kriging_data(\n",
" unknown_position,\n",
" data_array,\n",
" number_of_neighbours=10)\n",
" neighbors_range,\n",
" min_number_of_neighbors=1,\n",
" max_number_of_neighbors=256\n",
")\n",
"```\n",
"\n",
"Function prepares data for kriging - array of point position, value and distance to an unknown point.\n",
Expand All @@ -157,7 +157,9 @@
"\n",
"- **unknown_position**: (_numpy array_) position of unknown value,\n",
"- **data_array**: (_numpy array_) known positions and their values,\n",
"- **number_of_neighbours**: (_int_) number of the closest locations to the unknown position.\n",
"- **neighbors_range**: (_float_) range within neighbors are included in the prediction,\n",
"- **min_number_of_neighbors**: (_int_) number of the n-closest neighbors used for interpolation if not any neighbor is selected within neighbors_range,\n",
"- **max_number_of_neighbors**: (_int_) maximum number of n-closest neighbors used for interpolation if there are too many neighbors in range. It speeds up calculations for large datasets.\n",
"\n",
"\n",
"OUTPUT:\n",
Expand Down Expand Up @@ -462,7 +464,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -476,7 +478,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.12"
}
},
"nbformat": 4,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 56ae18c

Please sign in to comment.