Skip to content

Commit

Permalink
Merge pull request #418 from DataverseLabs/417-calculate-distances---…
Browse files Browse the repository at this point in the history
…revision-for-version-10

417 calculate distances   revision for version 10
  • Loading branch information
SimonMolinsky authored Feb 19, 2024
2 parents 517ff51 + 438071b commit ff6ce4e
Show file tree
Hide file tree
Showing 122 changed files with 2,379 additions and 1,581 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ venv/
ENV/
env.bak/
venv.bak/
venv-model/

# Spyder project settings
.spyderproject
Expand Down
9 changes: 7 additions & 2 deletions readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# .readthedocs.yml
# ..readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs_oldies/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Expand All @@ -19,7 +25,6 @@ formats:

# Optionally set the version of Python and requirements required to build your docs_oldies
python:
version: "3.8"
install:
- requirements: docs/requirements.txt
- method: pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Pyinterpolate

**version 0.5** - *Mykolaiv*
**version 0.5.1** - *Mykolaiv*

---

Expand Down
7 changes: 5 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ Pyinterpolate is the Python library for **geostatistics** and **spatial statisti
Changes by date
===============

2023-XX-XX
2024-02-19
----------

**version 0.5.1**
**version 0.5.1** (*pre production development*)

* (enhancement) `interpolate_raster()` function takes `allow_approx_solutions` parameter, and it protects from `LinAlgError` that might occur if interpolation points are duplicated (due to the floating point number representation).
* (refactoring) `calc_point_to_point_distance` function refactored to `point_distance`, changed input parameters' schema,
* (refactoring) new selection method for unequally spaced bins: `select_values_between_lags`
* (debug) `np.float` type casting has been changed to `float`

2023-09-16
----------
Expand Down
2 changes: 1 addition & 1 deletion developer/dev_checks/debug_sandbox/check_cent_pk/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def centroid_poisson_kriging(semivariogram_model: TheoreticalVariogram,

# Distances between known blocks
coordinates = kriging_data[:, :values_column_index]
block_distances = calc_point_to_point_distance(coordinates).flatten()
block_distances = point_distance(coordinates, coordinates).flatten()
known_blocks_semivars = semivariogram_model.predict(block_distances)
predicted = np.array(known_blocks_semivars.reshape(n, n))
predicted = sem_to_cov(predicted, sill)
Expand Down
Binary file modified docs/build/doctrees/api/distance/distance.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/api/viz/viz.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 not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: edf624842dc85ad7caf2922992868dbf
config: 547607724c14a157e2d2e282259579a3
tags: 645f666f9bcd5a90fca523b33c5a78b7
7 changes: 4 additions & 3 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; Pyinterpolate 0.5.0 documentation</title>
<title>Overview: module code &#8212; Pyinterpolate 0.5.1 documentation</title>



Expand Down Expand Up @@ -108,7 +108,7 @@



<p class="title logo__title">Pyinterpolate 0.5.0 documentation</p>
<p class="title logo__title">Pyinterpolate 0.5.1 documentation</p>

</a></div>

Expand Down Expand Up @@ -417,6 +417,7 @@
<h1>All modules for which code is available</h1>
<ul><li><a href="pyinterpolate/distance/distance.html">pyinterpolate.distance.distance</a></li>
<li><a href="pyinterpolate/distance/gridding.html">pyinterpolate.distance.gridding</a></li>
<li><a href="pyinterpolate/distance/point.html">pyinterpolate.distance.point</a></li>
<li><a href="pyinterpolate/idw/idw.html">pyinterpolate.idw.idw</a></li>
<li><a href="pyinterpolate/io/read_data.html">pyinterpolate.io.read_data</a></li>
<li><a href="pyinterpolate/kriging/models/block/area_to_area_poisson_kriging.html">pyinterpolate.kriging.models.block.area_to_area_poisson_kriging</a></li>
Expand Down Expand Up @@ -481,7 +482,7 @@ <h1>All modules for which code is available</h1>
<div class="footer-item">
<p class="copyright">

© Copyright 2023, Szymon Moliński.
© Copyright 2024, Szymon Moliński.
<br/>

</p>
Expand Down
18 changes: 14 additions & 4 deletions docs/build/html/_modules/pyinterpolate/distance/distance.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>pyinterpolate.distance.distance &#8212; Pyinterpolate 0.4.1 documentation</title>
<title>pyinterpolate.distance.distance &#8212; Pyinterpolate 0.5.1 documentation</title>



Expand Down Expand Up @@ -108,7 +108,7 @@



<p class="title logo__title">Pyinterpolate 0.4.1 documentation</p>
<p class="title logo__title">Pyinterpolate 0.5.1 documentation</p>

</a></div>

Expand Down Expand Up @@ -424,6 +424,8 @@ <h1>Source code for pyinterpolate.distance.distance</h1><div class="highlight"><
<span class="sd">Authors</span>
<span class="sd">-------</span>
<span class="sd">1. Szymon Moliński | @SimonMolinsky</span>

<span class="sd">TODO: the file will be removed in version 1.0</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Union</span><span class="p">,</span> <span class="n">Iterable</span>
Expand All @@ -438,6 +440,8 @@ <h1>Source code for pyinterpolate.distance.distance</h1><div class="highlight"><
<span class="kn">from</span> <span class="nn">pyinterpolate.processing.preprocessing.blocks</span> <span class="kn">import</span> <span class="n">PointSupport</span>
<span class="kn">from</span> <span class="nn">pyinterpolate.processing.transform.transform</span> <span class="kn">import</span> <span class="n">point_support_to_dict</span><span class="p">,</span> <span class="n">block_dataframe_to_dict</span>

<span class="kn">from</span> <span class="nn">deprecation</span> <span class="kn">import</span> <span class="n">deprecated</span>


<span class="k">def</span> <span class="nf">_calc_b2b_dist_from_array</span><span class="p">(</span><span class="n">blocks</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Function calculates distances between blocks.</span>
Expand Down Expand Up @@ -725,7 +729,13 @@ <h1>Source code for pyinterpolate.distance.distance</h1><div class="highlight"><
<span class="k">return</span> <span class="n">angles</span>


<div class="viewcode-block" id="calc_point_to_point_distance"><a class="viewcode-back" href="../../../api/distance/distance.html#pyinterpolate.calc_point_to_point_distance">[docs]</a><span class="k">def</span> <span class="nf">calc_point_to_point_distance</span><span class="p">(</span><span class="n">points_a</span><span class="p">,</span> <span class="n">points_b</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<div class="viewcode-block" id="calc_point_to_point_distance"><a class="viewcode-back" href="../../../api/distance/distance.html#pyinterpolate.calc_point_to_point_distance">[docs]</a><span class="nd">@deprecated</span><span class="p">(</span>
<span class="n">deprecated_in</span><span class="o">=</span><span class="s1">&#39;0.5.1&#39;</span><span class="p">,</span>
<span class="n">removed_in</span><span class="o">=</span><span class="s1">&#39;1.0&#39;</span><span class="p">,</span>
<span class="n">current_version</span><span class="o">=</span><span class="s1">&#39;0.5.1&#39;</span><span class="p">,</span>
<span class="n">details</span><span class="o">=</span><span class="s2">&quot;Use `point_distance()` instead&quot;</span>
<span class="p">)</span>
<span class="k">def</span> <span class="nf">calc_point_to_point_distance</span><span class="p">(</span><span class="n">points_a</span><span class="p">,</span> <span class="n">points_b</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Function calculates distances between two group of points of a single group to itself.</span>

<span class="sd"> Parameters</span>
Expand Down Expand Up @@ -825,7 +835,7 @@ <h1>Source code for pyinterpolate.distance.distance</h1><div class="highlight"><
<div class="footer-item">
<p class="copyright">

© Copyright 2023, Szymon Moliński.
© Copyright 2024, Szymon Moliński.
<br/>

</p>
Expand Down
Loading

0 comments on commit ff6ce4e

Please sign in to comment.