Skip to content

Commit

Permalink
deploy: 4820007
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Oct 22, 2024
1 parent 57233ff commit 220ff2d
Show file tree
Hide file tree
Showing 79 changed files with 606 additions and 574 deletions.
Binary file modified .doctrees/api/xugrid.BarycentricInterpolator.doctree
Binary file not shown.
Binary file modified .doctrees/api/xugrid.CentroidLocatorRegridder.doctree
Binary file not shown.
Binary file modified .doctrees/api/xugrid.OverlapRegridder.doctree
Binary file not shown.
Binary file modified .doctrees/api/xugrid.RelativeOverlapRegridder.doctree
Binary file not shown.
Binary file modified .doctrees/changelog.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples-dev/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/examples-dev/voronoi.doctree
Binary file not shown.
Binary file modified .doctrees/examples/connectivity.doctree
Binary file not shown.
Binary file modified .doctrees/examples/overlap_regridder.doctree
Binary file not shown.
Binary file modified .doctrees/examples/partitioning.doctree
Binary file not shown.
Binary file modified .doctrees/examples/plotting.doctree
Binary file not shown.
Binary file modified .doctrees/examples/quick_overview.doctree
Binary file not shown.
Binary file modified .doctrees/examples/regridder_overview.doctree
Binary file not shown.
Binary file modified .doctrees/examples/selection.doctree
Binary file not shown.
Binary file modified .doctrees/examples/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/examples/vector_conversion.doctree
Binary file not shown.
Binary file modified .doctrees/sample_data/adh_san_diego.doctree
Binary file not shown.
Binary file modified .doctrees/sample_data/disk.doctree
Binary file not shown.
Binary file modified .doctrees/sample_data/elevation_nl.doctree
Binary file not shown.
Binary file modified .doctrees/sample_data/provinces_nl.doctree
Binary file not shown.
Binary file modified .doctrees/sample_data/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/sg_execution_times.doctree
Binary file not shown.
Binary file modified _downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip
Binary file not shown.
Binary file modified _downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/3e8af3e56da80727f8440a5b5f94f5cb/disk.zip
Binary file not shown.
Binary file modified _downloads/3eb350a8b54f214b88c5181e546a155e/adh_san_diego.zip
Binary file not shown.
Binary file modified _downloads/422003fc9b51482872f8f3701ce47abe/provinces_nl.zip
Binary file not shown.
Binary file modified _downloads/43d7b47db560c8c70c383a84a444ed83/connectivity.zip
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip
Binary file not shown.
Binary file modified _downloads/9be12df0ec6c323839ed0cb99cc89228/elevation_nl.zip
Binary file not shown.
Binary file modified _downloads/a50ba9731493d1c74010dcadb8694b20/selection.zip
Binary file not shown.
Binary file modified _downloads/cc393383c363f7c590c6ef714836f52a/xoxo.zip
Binary file not shown.
Binary file modified _downloads/d2379110fee2f2fbaf724f0142daaa8d/plotting.zip
Binary file not shown.
Binary file not shown.
22 changes: 13 additions & 9 deletions _modules/xugrid/regrid/regridder.html
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ <h1>Source code for xugrid.regrid.regridder</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="k">return</span> <span class="n">out</span>

<span class="k">def</span> <span class="nf">regrid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">object</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">UgridDataArray</span><span class="p">:</span>
<span class="k">def</span> <span class="nf">regrid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">xr</span><span class="o">.</span><span class="n">DataArray</span><span class="p">,</span> <span class="n">UgridDataArray</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="n">UgridDataArray</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Regrid the data from a DataArray from its old grid topology to the new</span>
<span class="sd"> target topology.</span>
Expand All @@ -611,7 +611,7 @@ <h1>Source code for xugrid.regrid.regridder</h1><div class="highlight"><pre>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> object: UgridDataArray or xarray.DataArray</span>
<span class="sd"> data: UgridDataArray or xarray.DataArray</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
Expand All @@ -624,17 +624,21 @@ <h1>Source code for xugrid.regrid.regridder</h1><div class="highlight"><pre>
<span class="c1"># But it causes problems with initializing a regridder</span>
<span class="c1"># from_dataset, because the name has been changed to</span>
<span class="c1"># __source_nFace.</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">object</span><span class="p">,</span> <span class="n">UgridDataArray</span><span class="p">):</span>
<span class="n">obj</span> <span class="o">=</span> <span class="nb">object</span><span class="o">.</span><span class="n">ugrid</span><span class="o">.</span><span class="n">obj</span>
<span class="n">source_dims</span> <span class="o">=</span> <span class="p">(</span><span class="nb">object</span><span class="o">.</span><span class="n">ugrid</span><span class="o">.</span><span class="n">grid</span><span class="o">.</span><span class="n">face_dimension</span><span class="p">,)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">obj</span> <span class="o">=</span> <span class="nb">object</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">xr</span><span class="o">.</span><span class="n">DataArray</span><span class="p">):</span>
<span class="n">obj</span> <span class="o">=</span> <span class="n">data</span>
<span class="n">source_dims</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;y&quot;</span><span class="p">,</span> <span class="s2">&quot;x&quot;</span><span class="p">)</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">UgridDataArray</span><span class="p">):</span>
<span class="n">obj</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">ugrid</span><span class="o">.</span><span class="n">obj</span>
<span class="n">source_dims</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">ugrid</span><span class="o">.</span><span class="n">grid</span><span class="o">.</span><span class="n">face_dimension</span><span class="p">,)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Expected DataArray or UgridDataAray, received: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="p">)</span>

<span class="n">missing_dims</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">source_dims</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="nb">object</span><span class="o">.</span><span class="n">dims</span><span class="p">)</span>
<span class="n">missing_dims</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">source_dims</span><span class="p">)</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">dims</span><span class="p">)</span>
<span class="k">if</span> <span class="n">missing_dims</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;object does not contain regridder source dimensions: </span><span class="si">{</span><span class="n">missing_dims</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="sa">f</span><span class="s2">&quot;data does not contain regridder source dimensions: </span><span class="si">{</span><span class="n">missing_dims</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="p">)</span>

<span class="n">regridded</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">regrid_dataarray</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">source_dims</span><span class="p">)</span>
Expand Down
13 changes: 13 additions & 0 deletions _sources/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@ Changed
coordinates; it now detects whether coordinates are 1D or 2D automatically.
Accordingly, :meth:`xugrid.Ugrid2d.from_structured_multicoord` should no
longer be used, and calling it will give a FutureWarning.
- The first argument of the ``.regrid`` methods of
:class:`xugrid.CentroidLocatorRegridder`, :class:`xugrid.OverlapRegridder`,
:class:`xugrid.RelativeOverlapRegridder`, and
:class:`xugrid.BarycentricInterpolator` has been renamed. The method now
takes a ``data`` argument instead of ``object``.

Added
~~~~~

- :meth:`xugrid.UgridDataset.from_structured` has been added to create
UgriDatasets from xarray Datasets.

Fixed
~~~~~

- The ``.regrid`` methods of :class:`xugrid.CentroidLocatorRegridder`,
:class:`xugrid.OverlapRegridder`, :class:`xugrid.RelativeOverlapRegridder`,
and :class:`xugrid.BarycentricInterpolator` now raise a TypeError if an
inappropriate type is provided.

[0.12.1] 2024-09-09
-------------------

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

Computation times
=================
**00:01.313** total execution time for 1 file **from examples-dev**:
**00:01.333** total execution time for 1 file **from examples-dev**:

.. container::

Expand All @@ -33,5 +33,5 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_examples-dev_voronoi.py` (``voronoi.py``)
- 00:01.313
- 00:01.333
- 0.0
2 changes: 1 addition & 1 deletion _sources/examples-dev/voronoi.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ The figure shows:
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 1.313 seconds)
**Total running time of the script:** (0 minutes 1.333 seconds)


.. _sphx_glr_download_examples-dev_voronoi.py:
Expand Down
26 changes: 13 additions & 13 deletions _sources/examples/connectivity.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ By default, the border value for binary erosion is set to ``False`` (equal to
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72ae0fa7e0>
<matplotlib.collections.PolyCollection object at 0x7f8f590d1970>
Expand Down Expand Up @@ -165,7 +165,7 @@ start by setting a single value in the center of the grid to ``True``.
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72a460a030>
<matplotlib.collections.PolyCollection object at 0x7f8f4f17fc20>
Expand Down Expand Up @@ -200,7 +200,7 @@ alternative border value:
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72a4a1d0d0>
<matplotlib.collections.PolyCollection object at 0x7f8f4f438f80>
Expand Down Expand Up @@ -238,7 +238,7 @@ analyse connected parts of the mesh.
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72af2c7ef0>
<matplotlib.collections.PolyCollection object at 0x7f8f4e39fc80>
Expand Down Expand Up @@ -272,7 +272,7 @@ Tesselation.
.. code-block:: none
<matplotlib.collections.LineCollection object at 0x7f72a4905e50>
<matplotlib.collections.LineCollection object at 0x7f8f590c7050>
Expand Down Expand Up @@ -316,7 +316,7 @@ the original.
.. code-block:: none
<matplotlib.collections.LineCollection object at 0x7f72a53e5130>
<matplotlib.collections.LineCollection object at 0x7f8f59164230>
Expand Down Expand Up @@ -355,7 +355,7 @@ We can break down one of the Voronoi tesselations from above into triangles:
.. code-block:: none
<matplotlib.collections.LineCollection object at 0x7f72a5747050>
<matplotlib.collections.LineCollection object at 0x7f8f4f2a20f0>
Expand Down Expand Up @@ -409,7 +409,7 @@ the upper and lower parts:
.. code-block:: none
<matplotlib.collections.LineCollection object at 0x7f72a556f6e0>
<matplotlib.collections.LineCollection object at 0x7f8f4e7f76e0>
Expand Down Expand Up @@ -439,7 +439,7 @@ We can now use Laplace interpolation to fill the gaps in the grid.
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72a58c2f60>
<matplotlib.collections.PolyCollection object at 0x7f8f4f631d90>
Expand Down Expand Up @@ -477,7 +477,7 @@ interpolation.
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72a4810170>
<matplotlib.collections.PolyCollection object at 0x7f8f4f600920>
Expand Down Expand Up @@ -518,7 +518,7 @@ To illustrate, let's take a look at the connectivity matrix of the Xoxo grid.
.. code-block:: none
<matplotlib.image.AxesImage object at 0x7f72a585a420>
<matplotlib.image.AxesImage object at 0x7f8f4e43e8d0>
Expand Down Expand Up @@ -554,14 +554,14 @@ locality:
.. code-block:: none
<matplotlib.image.AxesImage object at 0x7f72a5747320>
<matplotlib.image.AxesImage object at 0x7f8f4fd1f2c0>
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 1.366 seconds)
**Total running time of the script:** (0 minutes 1.375 seconds)


.. _sphx_glr_download_examples_connectivity.py:
Expand Down
10 changes: 5 additions & 5 deletions _sources/examples/overlap_regridder.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ some bathymetry) of the Netherlands, and a coarser target grid.
.. code-block:: none
<matplotlib.collections.LineCollection object at 0x7f72a54c6a20>
<matplotlib.collections.LineCollection object at 0x7f8f4f3daf00>
Expand Down Expand Up @@ -202,7 +202,7 @@ conservative methods, such as conductance:
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72af1f0320>
<matplotlib.collections.PolyCollection object at 0x7f8f4f1300e0>
Expand Down Expand Up @@ -298,7 +298,7 @@ OverlapRegridder:
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72aef82990>
<matplotlib.collections.PolyCollection object at 0x7f8f57e07fb0>
Expand Down Expand Up @@ -373,7 +373,7 @@ Then, provide it as the regridder method as above:
.. code-block:: none
<matplotlib.collections.PolyCollection object at 0x7f72a495d820>
<matplotlib.collections.PolyCollection object at 0x7f8f4e53fc20>
Expand All @@ -384,7 +384,7 @@ Then, provide it as the regridder method as above:

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

**Total running time of the script:** (0 minutes 3.920 seconds)
**Total running time of the script:** (0 minutes 3.969 seconds)


.. _sphx_glr_download_examples_overlap_regridder.py:
Expand Down
Loading

0 comments on commit 220ff2d

Please sign in to comment.