Skip to content

Commit

Permalink
deploy: 41953fe
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Jul 17, 2024
1 parent fdb389c commit d362203
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .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: 78bfbccb42ead2c17534c3edc9d79023
config: c21e735eab84c3aa0e238b171d1ab8ac
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified .doctrees/api.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/examples/spatial_indexing.doctree
Binary file not shown.
Binary file modified .doctrees/sg_execution_times.doctree
Binary file not shown.
Binary file modified _downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
We'll start by importing the required packages with matplotlib for plotting.
"""

import os

import matplotlib.pyplot as plt
Expand Down
Binary file modified _downloads/fb625db3c50d423b1b7881136ffdeec8/examples_jupyter.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ <h1>All modules for which code is available</h1>
<div class="footer-item">

<p class="sphinx-version">
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.5.
<br/>
</p>
</div>
Expand Down
12 changes: 6 additions & 6 deletions _modules/numba_celltree/celltree.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,14 @@ <h1>Source code for numba_celltree.celltree</h1><div class="highlight"><pre>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="kn">from</span> <span class="nn">.algorithms</span> <span class="kn">import</span> <span class="p">(</span>
<span class="kn">from</span> <span class="nn">numba_celltree.algorithms</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">area_of_intersection</span><span class="p">,</span>
<span class="n">barycentric_triangle_weights</span><span class="p">,</span>
<span class="n">barycentric_wachspress_weights</span><span class="p">,</span>
<span class="n">box_area_of_intersection</span><span class="p">,</span>
<span class="n">polygons_intersect</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">.constants</span> <span class="kn">import</span> <span class="p">(</span>
<span class="kn">from</span> <span class="nn">numba_celltree.constants</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">FILL_VALUE</span><span class="p">,</span>
<span class="n">MAX_N_FACE</span><span class="p">,</span>
<span class="n">MAX_N_VERTEX</span><span class="p">,</span>
Expand All @@ -401,9 +401,9 @@ <h1>Source code for numba_celltree.celltree</h1><div class="highlight"><pre>
<span class="n">IntArray</span><span class="p">,</span>
<span class="n">IntDType</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">.creation</span> <span class="kn">import</span> <span class="n">initialize</span>
<span class="kn">from</span> <span class="nn">.geometry_utils</span> <span class="kn">import</span> <span class="n">build_bboxes</span><span class="p">,</span> <span class="n">counter_clockwise</span>
<span class="kn">from</span> <span class="nn">.query</span> <span class="kn">import</span> <span class="p">(</span>
<span class="kn">from</span> <span class="nn">numba_celltree.creation</span> <span class="kn">import</span> <span class="n">initialize</span>
<span class="kn">from</span> <span class="nn">numba_celltree.geometry_utils</span> <span class="kn">import</span> <span class="n">build_bboxes</span><span class="p">,</span> <span class="n">counter_clockwise</span>
<span class="kn">from</span> <span class="nn">numba_celltree.query</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">collect_node_bounds</span><span class="p">,</span>
<span class="n">locate_boxes</span><span class="p">,</span>
<span class="n">locate_edges</span><span class="p">,</span>
Expand Down Expand Up @@ -874,7 +874,7 @@ <h1>Source code for numba_celltree.celltree</h1><div class="highlight"><pre>
<div class="footer-item">

<p class="sphinx-version">
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.5.
<br/>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions _sources/examples/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:00.773** total execution time for 1 file **from examples**:
**00:00.746** total execution time for 1 file **from examples**:

.. container::

Expand All @@ -33,5 +33,5 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_examples_spatial_indexing.py` (``spatial_indexing.py``)
- 00:00.773
- 00:00.746
- 0.0
71 changes: 36 additions & 35 deletions _sources/examples/spatial_indexing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ these.

We'll start by importing the required packages with matplotlib for plotting.

.. GENERATED FROM PYTHON SOURCE LINES 27-36
.. GENERATED FROM PYTHON SOURCE LINES 27-37
.. code-block:: Python
import os
import matplotlib.pyplot as plt
Expand All @@ -63,11 +64,11 @@ We'll start by importing the required packages with matplotlib for plotting.
.. GENERATED FROM PYTHON SOURCE LINES 37-38
.. GENERATED FROM PYTHON SOURCE LINES 38-39
Let's start with a rectangular mesh:

.. GENERATED FROM PYTHON SOURCE LINES 38-44
.. GENERATED FROM PYTHON SOURCE LINES 39-45
.. code-block:: Python
Expand All @@ -84,11 +85,11 @@ Let's start with a rectangular mesh:
.. GENERATED FROM PYTHON SOURCE LINES 45-46
.. GENERATED FROM PYTHON SOURCE LINES 46-47
Determine the edges of the cells, and plot them.

.. GENERATED FROM PYTHON SOURCE LINES 46-52
.. GENERATED FROM PYTHON SOURCE LINES 47-53
.. code-block:: Python
Expand All @@ -110,14 +111,14 @@ Determine the edges of the cells, and plot them.



.. GENERATED FROM PYTHON SOURCE LINES 53-57
.. GENERATED FROM PYTHON SOURCE LINES 54-58
Locating points
---------------

We'll build a cell tree first, then look for some points.

.. GENERATED FROM PYTHON SOURCE LINES 57-68
.. GENERATED FROM PYTHON SOURCE LINES 58-69
.. code-block:: Python
Expand Down Expand Up @@ -145,7 +146,7 @@ We'll build a cell tree first, then look for some points.
.. GENERATED FROM PYTHON SOURCE LINES 69-75
.. GENERATED FROM PYTHON SOURCE LINES 70-76
These numbers are the cell numbers in which we can find the points.

Expand All @@ -154,7 +155,7 @@ A value of -1 means that a point is not located in any cell.
Let's get rid of the -1 values, and take a look which cells have been found.
We'll color the found cells blue, and we'll draw the nodes to compare.

.. GENERATED FROM PYTHON SOURCE LINES 75-82
.. GENERATED FROM PYTHON SOURCE LINES 76-83
.. code-block:: Python
Expand All @@ -177,11 +178,11 @@ We'll color the found cells blue, and we'll draw the nodes to compare.



.. GENERATED FROM PYTHON SOURCE LINES 83-84
.. GENERATED FROM PYTHON SOURCE LINES 84-85
Now let's try a more exotic example.

.. GENERATED FROM PYTHON SOURCE LINES 84-93
.. GENERATED FROM PYTHON SOURCE LINES 85-94
.. code-block:: Python
Expand All @@ -206,13 +207,13 @@ Now let's try a more exotic example.



.. GENERATED FROM PYTHON SOURCE LINES 94-97
.. GENERATED FROM PYTHON SOURCE LINES 95-98
There are certainly no rows or columns to speak of!

Let's build a new tree, and look for the same points as before.

.. GENERATED FROM PYTHON SOURCE LINES 97-106
.. GENERATED FROM PYTHON SOURCE LINES 98-107
.. code-block:: Python
Expand All @@ -237,7 +238,7 @@ Let's build a new tree, and look for the same points as before.



.. GENERATED FROM PYTHON SOURCE LINES 107-122
.. GENERATED FROM PYTHON SOURCE LINES 108-123
It should be clear by now that a point may only fall into a single cell. A
point may also be out of bounds. If a cell falls exactly on an edge, one of the
Expand All @@ -255,7 +256,7 @@ A search of N points will yield N answers (cell numbers). A search of N boxes
may yield M answers. To illustrate, let's look for all the cells inside of
a box.

.. GENERATED FROM PYTHON SOURCE LINES 122-136
.. GENERATED FROM PYTHON SOURCE LINES 123-137
.. code-block:: Python
Expand Down Expand Up @@ -285,11 +286,11 @@ a box.



.. GENERATED FROM PYTHON SOURCE LINES 137-138
.. GENERATED FROM PYTHON SOURCE LINES 138-139
We can also search for multiple boxes:

.. GENERATED FROM PYTHON SOURCE LINES 138-148
.. GENERATED FROM PYTHON SOURCE LINES 139-149
.. code-block:: Python
Expand Down Expand Up @@ -322,15 +323,15 @@ We can also search for multiple boxes:
.. GENERATED FROM PYTHON SOURCE LINES 149-154
.. GENERATED FROM PYTHON SOURCE LINES 150-155
Note that this method returns two arrays of equal length. The second array
contains the cell numbers, as usual. The first array contains the index of
the bounding box in which the respective cells fall. Note that there are only
two numbers in ``box_i``: there are no cells located in the third box, as we
can confirm visually:

.. GENERATED FROM PYTHON SOURCE LINES 154-167
.. GENERATED FROM PYTHON SOURCE LINES 155-168
.. code-block:: Python
Expand Down Expand Up @@ -359,7 +360,7 @@ can confirm visually:



.. GENERATED FROM PYTHON SOURCE LINES 168-179
.. GENERATED FROM PYTHON SOURCE LINES 169-180
Locating cells
--------------
Expand All @@ -373,7 +374,7 @@ This returns three arrays of equal length:
* the index of the face in the celtree
* the area of the intersection

.. GENERATED FROM PYTHON SOURCE LINES 179-211
.. GENERATED FROM PYTHON SOURCE LINES 180-212
.. code-block:: Python
Expand Down Expand Up @@ -421,14 +422,14 @@ This returns three arrays of equal length:



.. GENERATED FROM PYTHON SOURCE LINES 212-216
.. GENERATED FROM PYTHON SOURCE LINES 213-217
Let's color the faces of the mesh by their ratio of overlap. Because our
mesh is triangular, we can represent the triangles as two collections of
vectors (V, U). Then the area is half of the absolute value of the cross
product of U and V.

.. GENERATED FROM PYTHON SOURCE LINES 216-234
.. GENERATED FROM PYTHON SOURCE LINES 217-235
.. code-block:: Python
Expand Down Expand Up @@ -463,19 +464,19 @@ product of U and V.

.. code-block:: none
/home/runner/work/numba_celltree/numba_celltree/examples/spatial_indexing.py:220: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
/home/runner/work/numba_celltree/numba_celltree/examples/spatial_indexing.py:221: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
full_area = 0.5 * np.abs(np.cross(V, U))
.. GENERATED FROM PYTHON SOURCE LINES 235-238
.. GENERATED FROM PYTHON SOURCE LINES 236-239
``CellTree2d`` also provides a method to compute overlaps between boxes and a
mesh. This may come in handy to compute overlap with a raster, for example to
rasterize a mesh.

.. GENERATED FROM PYTHON SOURCE LINES 238-258
.. GENERATED FROM PYTHON SOURCE LINES 239-259
.. code-block:: Python
Expand Down Expand Up @@ -506,12 +507,12 @@ rasterize a mesh.
.. GENERATED FROM PYTHON SOURCE LINES 259-261
.. GENERATED FROM PYTHON SOURCE LINES 260-262
We can construct a weight matrix with these arrays. This weight matrix stores
for every raster cell (row) the area of overlap with a triangle (column).

.. GENERATED FROM PYTHON SOURCE LINES 261-268
.. GENERATED FROM PYTHON SOURCE LINES 262-269
.. code-block:: Python
Expand All @@ -534,13 +535,13 @@ for every raster cell (row) the area of overlap with a triangle (column).



.. GENERATED FROM PYTHON SOURCE LINES 269-272
.. GENERATED FROM PYTHON SOURCE LINES 270-273
This weight matrix can be used for translating data from one mesh to another.
Let's generate some mock elevation data for a valley. Then, we'll compute the
area weighted mean for every raster cell.

.. GENERATED FROM PYTHON SOURCE LINES 272-298
.. GENERATED FROM PYTHON SOURCE LINES 273-299
.. code-block:: Python
Expand Down Expand Up @@ -582,7 +583,7 @@ area weighted mean for every raster cell.



.. GENERATED FROM PYTHON SOURCE LINES 299-323
.. GENERATED FROM PYTHON SOURCE LINES 300-324
Such a weight matrix doesn't apply to just boxes and triangles, but to every
case of mapping one mesh to another by intersecting cell areas. Note however
Expand All @@ -609,7 +610,7 @@ This once again returns three arrays of equal length:
* the index of the cell
* the location of the intersection

.. GENERATED FROM PYTHON SOURCE LINES 323-332
.. GENERATED FROM PYTHON SOURCE LINES 324-333
.. code-block:: Python
Expand Down Expand Up @@ -638,13 +639,13 @@ This once again returns three arrays of equal length:
.. GENERATED FROM PYTHON SOURCE LINES 333-336
.. GENERATED FROM PYTHON SOURCE LINES 334-337
To wrap up, we'll color the intersect faces with the length of the
intersected line segments. We can easily compute the length of each segment
with the Euclidian norm (Pythagorean distance):

.. GENERATED FROM PYTHON SOURCE LINES 336-348
.. GENERATED FROM PYTHON SOURCE LINES 337-349
.. code-block:: Python
Expand Down Expand Up @@ -675,7 +676,7 @@ with the Euclidian norm (Pythagorean distance):

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 0.773 seconds)
**Total running time of the script:** (0 minutes 0.746 seconds)


.. _sphx_glr_download_examples_spatial_indexing.py:
Expand Down
4 changes: 2 additions & 2 deletions _sources/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:00.773** total execution time for 1 file **from all galleries**:
**00:00.746** total execution time for 1 file **from all galleries**:

.. container::

Expand All @@ -33,5 +33,5 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_examples_spatial_indexing.py` (``../examples/spatial_indexing.py``)
- 00:00.773
- 00:00.746
- 0.0
Loading

0 comments on commit d362203

Please sign in to comment.