diff --git a/.doctrees/api/xugrid.OverlapRegridder.doctree b/.doctrees/api/xugrid.OverlapRegridder.doctree index fc4b2032b..65f691893 100644 Binary files a/.doctrees/api/xugrid.OverlapRegridder.doctree and b/.doctrees/api/xugrid.OverlapRegridder.doctree differ diff --git a/.doctrees/changelog.doctree b/.doctrees/changelog.doctree index 0511b4cee..efadfa090 100644 Binary files a/.doctrees/changelog.doctree and b/.doctrees/changelog.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index b6ef220c2..458f11e75 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/examples-dev/sg_execution_times.doctree b/.doctrees/examples-dev/sg_execution_times.doctree index 1f7c904cb..30a21d9c9 100644 Binary files a/.doctrees/examples-dev/sg_execution_times.doctree and b/.doctrees/examples-dev/sg_execution_times.doctree differ diff --git a/.doctrees/examples-dev/voronoi.doctree b/.doctrees/examples-dev/voronoi.doctree index 820a810a9..6643c0c73 100644 Binary files a/.doctrees/examples-dev/voronoi.doctree and b/.doctrees/examples-dev/voronoi.doctree differ diff --git a/.doctrees/examples/connectivity.doctree b/.doctrees/examples/connectivity.doctree index 96475083c..044e3e026 100644 Binary files a/.doctrees/examples/connectivity.doctree and b/.doctrees/examples/connectivity.doctree differ diff --git a/.doctrees/examples/overlap_regridder.doctree b/.doctrees/examples/overlap_regridder.doctree index d65f6f80c..9ec0f4d70 100644 Binary files a/.doctrees/examples/overlap_regridder.doctree and b/.doctrees/examples/overlap_regridder.doctree differ diff --git a/.doctrees/examples/partitioning.doctree b/.doctrees/examples/partitioning.doctree index 92b204787..76dfd2481 100644 Binary files a/.doctrees/examples/partitioning.doctree and b/.doctrees/examples/partitioning.doctree differ diff --git a/.doctrees/examples/plotting.doctree b/.doctrees/examples/plotting.doctree index 131a79065..ae3167e6c 100644 Binary files a/.doctrees/examples/plotting.doctree and b/.doctrees/examples/plotting.doctree differ diff --git a/.doctrees/examples/quick_overview.doctree b/.doctrees/examples/quick_overview.doctree index 0a4ea777c..52efad864 100644 Binary files a/.doctrees/examples/quick_overview.doctree and b/.doctrees/examples/quick_overview.doctree differ diff --git a/.doctrees/examples/regridder_overview.doctree b/.doctrees/examples/regridder_overview.doctree index 07734613b..c98a1d5d4 100644 Binary files a/.doctrees/examples/regridder_overview.doctree and b/.doctrees/examples/regridder_overview.doctree differ diff --git a/.doctrees/examples/selection.doctree b/.doctrees/examples/selection.doctree index 53243925e..f6bfb40a9 100644 Binary files a/.doctrees/examples/selection.doctree and b/.doctrees/examples/selection.doctree differ diff --git a/.doctrees/examples/sg_execution_times.doctree b/.doctrees/examples/sg_execution_times.doctree index ce8173f9b..2e0b2589c 100644 Binary files a/.doctrees/examples/sg_execution_times.doctree and b/.doctrees/examples/sg_execution_times.doctree differ diff --git a/.doctrees/examples/vector_conversion.doctree b/.doctrees/examples/vector_conversion.doctree index 9a1dfdf8b..4fe3a5525 100644 Binary files a/.doctrees/examples/vector_conversion.doctree and b/.doctrees/examples/vector_conversion.doctree differ diff --git a/.doctrees/sample_data/adh_san_diego.doctree b/.doctrees/sample_data/adh_san_diego.doctree index 79b947ace..985bbc890 100644 Binary files a/.doctrees/sample_data/adh_san_diego.doctree and b/.doctrees/sample_data/adh_san_diego.doctree differ diff --git a/.doctrees/sample_data/disk.doctree b/.doctrees/sample_data/disk.doctree index 5e64cf914..d41e1bd4f 100644 Binary files a/.doctrees/sample_data/disk.doctree and b/.doctrees/sample_data/disk.doctree differ diff --git a/.doctrees/sample_data/elevation_nl.doctree b/.doctrees/sample_data/elevation_nl.doctree index 090368cb3..e38562737 100644 Binary files a/.doctrees/sample_data/elevation_nl.doctree and b/.doctrees/sample_data/elevation_nl.doctree differ diff --git a/.doctrees/sample_data/provinces_nl.doctree b/.doctrees/sample_data/provinces_nl.doctree index 13a4f5068..5104bc118 100644 Binary files a/.doctrees/sample_data/provinces_nl.doctree and b/.doctrees/sample_data/provinces_nl.doctree differ diff --git a/.doctrees/sample_data/sg_execution_times.doctree b/.doctrees/sample_data/sg_execution_times.doctree index f163d4340..bca87e956 100644 Binary files a/.doctrees/sample_data/sg_execution_times.doctree and b/.doctrees/sample_data/sg_execution_times.doctree differ diff --git a/.doctrees/sg_execution_times.doctree b/.doctrees/sg_execution_times.doctree index 2b4fe9db5..b72ef06f7 100644 Binary files a/.doctrees/sg_execution_times.doctree and b/.doctrees/sg_execution_times.doctree differ diff --git a/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip b/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip index 6ec8373cf..0119ce4a4 100644 Binary files a/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip and b/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip differ diff --git a/_downloads/2113e51a6a17a0230a513258e99cc8d1/overlap_regridder.ipynb b/_downloads/2113e51a6a17a0230a513258e99cc8d1/overlap_regridder.ipynb index 6551ec2e5..588f87794 100644 --- a/_downloads/2113e51a6a17a0230a513258e99cc8d1/overlap_regridder.ipynb +++ b/_downloads/2113e51a6a17a0230a513258e99cc8d1/overlap_regridder.ipynb @@ -87,7 +87,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Custom reductions\n\nIt's also possible to define your own reduction methods. Such a method is\ninserted during the ``.regrid`` call and compiled by `Numba`_ for performance.\n\nA valid reduction method must be compileable by Numba, and takes exactly three\narguments: ``values``, ``indices``, ``weights``.\n\n* ``values``: is the array containing the (float) source values.\n* ``weights``: contains the (float) overlap between the target face and the\n source faces. The size of ``weights`` is equal to the size of ``indices``.\n* ``work``: used as a temporary workspace. Contains one float value for each\n index in indices.\n\nXugrid regridder reduction functions are implemented in such a way. For a\nexample, an area weighted sum could be implemented as follows:\n\n" + "## Custom reductions\n\nIt's also possible to define your own reduction methods. Such a method is\ninserted during the ``.regrid`` call and compiled by `Numba`_ for performance.\n\nA valid reduction method must be compileable by Numba, and takes exactly three\narguments: ``values``, ``indices``, ``weights``.\n\n* ``values``: is the array containing the (float) source values.\n* ``weights``: contains the (float) overlap between the target face and the\n source faces. The size of ``weights`` is equal to the size of ``values``.\n* ``work``: used as a temporary workspace of floats. The size of ``work`` is\n equal to the size of ``values``.\n\nXugrid regridder reduction functions are implemented in such a way. For a\nexample, an area weighted sum could be implemented as follows:\n\n" ] }, { @@ -98,14 +98,14 @@ }, "outputs": [], "source": [ - "def mean(values, weights, workspace):\n total = 0.0\n weight_sum = 0.0\n for value, weight in zip(values, weights):\n if ~np.isnan(value):\n total = +value * weight\n weight_sum += weight\n if weight_sum == 0.0:\n return np.nan\n return total / weight_sum" + "def mean(values, weights, workspace):\n total = 0.0\n weight_sum = 0.0\n for value, weight in zip(values, weights):\n if ~np.isnan(value):\n total += value * weight\n weight_sum += weight\n if weight_sum == 0.0:\n return np.nan\n return total / weight_sum" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "

Note

* Each reduction must return a single float.\n * Custom reductions methods must be able to deal with NaN values as these\n are commonly encountered in datasets as a \"no data value\".\n * If Python features are used that are unsupported by Numba, you will get\n somewhat obscure errors. In such a case, test your function with\n synthetic values for ``values, weights, workspace``.\n * The ``workspace`` array is provided to avoid dynamic memory allocations.\n It is a an array of floats with the same size as ``values`` or\n ``weights``. You may freely allocate new arrays within the reduction\n function but it will impact performance.\n * While we could have implemented a weighted mean as:\n ``np.nansum(values * weights) / np.nansum(weights)``, the function above\n is efficiently compiled by Numba and does not allocate.

\n\nTo use our custom method, we provide at initialization of the OverlapRegridder:\n\n" + "

Note

* Each reduction must return a single float.\n * Always check for ``np.isnan(value)``: Custom reductions methods must be\n able to deal with NaN values as these are commonly encountered in datasets\n as a \"no data value\".\n * If Python features are used that are unsupported by Numba, you will get\n somewhat obscure errors. In such a case, ``numba.njit`` and test your\n function separately with synthetic values for ``values, weights,\n workspace``.\n * The ``workspace`` array is provided to avoid dynamic memory allocations.\n It is a an array of floats with the same size as ``values`` or\n ``weights``. You may freely allocate new arrays within the reduction\n function but it will impact performance. (Methods such as mode or median\n require a workspace.)\n * While we could have implemented a weighted mean as:\n ``np.nansum(values * weights) / np.nansum(weights)``, the function above\n is efficiently compiled by Numba and does not allocate temporary arrays.

\n\nTo use our custom method, we provide it at initialization of the\nOverlapRegridder:\n\n" ] }, { @@ -123,7 +123,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Not every reduction uses the ``weights`` and ``workspace`` arguments. For\nexample, a regular sum:\n\n" + "Not every reduction uses the ``weights`` and ``workspace`` arguments. For\nexample, a regular sum could only look at the values:\n\n" ] }, { @@ -141,7 +141,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Always ensure that the function can deal with NaN values!\n\n## Custom percentiles\n\nXugrid provides a number of predefined percentiles (5, 10, 25, 50, 75, 90,\n95). In case you need a different percentile value, you can use this utility:\n\n" + "## Custom percentiles\n\nXugrid provides a number of predefined percentiles (5, 10, 25, 50, 75, 90,\n95). In case you need a different percentile value, you can use this utility:\n\n" ] }, { diff --git a/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip b/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip index 59ce7875b..dee068f9c 100644 Binary files a/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip and b/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip differ diff --git a/_downloads/37998fdc2548b23faf513b314db93d21/regridder_overview.zip b/_downloads/37998fdc2548b23faf513b314db93d21/regridder_overview.zip index d265649c3..0dacce8d0 100644 Binary files a/_downloads/37998fdc2548b23faf513b314db93d21/regridder_overview.zip and b/_downloads/37998fdc2548b23faf513b314db93d21/regridder_overview.zip differ diff --git a/_downloads/3e8af3e56da80727f8440a5b5f94f5cb/disk.zip b/_downloads/3e8af3e56da80727f8440a5b5f94f5cb/disk.zip index 7d7cad06e..620752232 100644 Binary files a/_downloads/3e8af3e56da80727f8440a5b5f94f5cb/disk.zip and b/_downloads/3e8af3e56da80727f8440a5b5f94f5cb/disk.zip differ diff --git a/_downloads/3eb350a8b54f214b88c5181e546a155e/adh_san_diego.zip b/_downloads/3eb350a8b54f214b88c5181e546a155e/adh_san_diego.zip index ee29517d3..ae54a9cc2 100644 Binary files a/_downloads/3eb350a8b54f214b88c5181e546a155e/adh_san_diego.zip and b/_downloads/3eb350a8b54f214b88c5181e546a155e/adh_san_diego.zip differ diff --git a/_downloads/422003fc9b51482872f8f3701ce47abe/provinces_nl.zip b/_downloads/422003fc9b51482872f8f3701ce47abe/provinces_nl.zip index 794324ce5..4481688a4 100644 Binary files a/_downloads/422003fc9b51482872f8f3701ce47abe/provinces_nl.zip and b/_downloads/422003fc9b51482872f8f3701ce47abe/provinces_nl.zip differ diff --git a/_downloads/43d7b47db560c8c70c383a84a444ed83/connectivity.zip b/_downloads/43d7b47db560c8c70c383a84a444ed83/connectivity.zip index 0fc4ba278..423b75c68 100644 Binary files a/_downloads/43d7b47db560c8c70c383a84a444ed83/connectivity.zip and b/_downloads/43d7b47db560c8c70c383a84a444ed83/connectivity.zip differ diff --git a/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip b/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip index fc4037284..8b443e574 100644 Binary files a/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip and b/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip differ diff --git a/_downloads/9510c04155266403a85c77c93b648199/overlap_regridder.py b/_downloads/9510c04155266403a85c77c93b648199/overlap_regridder.py index ec78e7a37..55dcfc6e0 100644 --- a/_downloads/9510c04155266403a85c77c93b648199/overlap_regridder.py +++ b/_downloads/9510c04155266403a85c77c93b648199/overlap_regridder.py @@ -113,9 +113,9 @@ def create_grid(bounds, nx, ny): # # * ``values``: is the array containing the (float) source values. # * ``weights``: contains the (float) overlap between the target face and the -# source faces. The size of ``weights`` is equal to the size of ``indices``. -# * ``work``: used as a temporary workspace. Contains one float value for each -# index in indices. +# source faces. The size of ``weights`` is equal to the size of ``values``. +# * ``work``: used as a temporary workspace of floats. The size of ``work`` is +# equal to the size of ``values``. # # Xugrid regridder reduction functions are implemented in such a way. For a # example, an area weighted sum could be implemented as follows: @@ -126,7 +126,7 @@ def mean(values, weights, workspace): weight_sum = 0.0 for value, weight in zip(values, weights): if ~np.isnan(value): - total = +value * weight + total += value * weight weight_sum += weight if weight_sum == 0.0: return np.nan @@ -136,20 +136,24 @@ def mean(values, weights, workspace): # %% # .. note:: # * Each reduction must return a single float. -# * Custom reductions methods must be able to deal with NaN values as these -# are commonly encountered in datasets as a "no data value". +# * Always check for ``np.isnan(value)``: Custom reductions methods must be +# able to deal with NaN values as these are commonly encountered in datasets +# as a "no data value". # * If Python features are used that are unsupported by Numba, you will get -# somewhat obscure errors. In such a case, test your function with -# synthetic values for ``values, weights, workspace``. +# somewhat obscure errors. In such a case, ``numba.njit`` and test your +# function separately with synthetic values for ``values, weights, +# workspace``. # * The ``workspace`` array is provided to avoid dynamic memory allocations. # It is a an array of floats with the same size as ``values`` or # ``weights``. You may freely allocate new arrays within the reduction -# function but it will impact performance. +# function but it will impact performance. (Methods such as mode or median +# require a workspace.) # * While we could have implemented a weighted mean as: # ``np.nansum(values * weights) / np.nansum(weights)``, the function above -# is efficiently compiled by Numba and does not allocate. +# is efficiently compiled by Numba and does not allocate temporary arrays. # -# To use our custom method, we provide at initialization of the OverlapRegridder: +# To use our custom method, we provide it at initialization of the +# OverlapRegridder: regridder = xu.OverlapRegridder(uda, grid, method=mean) result = regridder.regrid(uda) @@ -157,7 +161,7 @@ def mean(values, weights, workspace): # %% # Not every reduction uses the ``weights`` and ``workspace`` arguments. For -# example, a regular sum: +# example, a regular sum could only look at the values: def nansum(values, weights, workspace): @@ -165,8 +169,6 @@ def nansum(values, weights, workspace): # %% -# Always ensure that the function can deal with NaN values! -# # Custom percentiles # ------------------ # diff --git a/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip b/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip index 0ce3e34d3..b786bb383 100644 Binary files a/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip and b/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip differ diff --git a/_downloads/9be12df0ec6c323839ed0cb99cc89228/elevation_nl.zip b/_downloads/9be12df0ec6c323839ed0cb99cc89228/elevation_nl.zip index ed0e72b56..15dd51214 100644 Binary files a/_downloads/9be12df0ec6c323839ed0cb99cc89228/elevation_nl.zip and b/_downloads/9be12df0ec6c323839ed0cb99cc89228/elevation_nl.zip differ diff --git a/_downloads/a50ba9731493d1c74010dcadb8694b20/selection.zip b/_downloads/a50ba9731493d1c74010dcadb8694b20/selection.zip index d1cbe4f9d..72d08aa50 100644 Binary files a/_downloads/a50ba9731493d1c74010dcadb8694b20/selection.zip and b/_downloads/a50ba9731493d1c74010dcadb8694b20/selection.zip differ diff --git a/_downloads/cc393383c363f7c590c6ef714836f52a/xoxo.zip b/_downloads/cc393383c363f7c590c6ef714836f52a/xoxo.zip index 4615aa4be..cc848e4c4 100644 Binary files a/_downloads/cc393383c363f7c590c6ef714836f52a/xoxo.zip and b/_downloads/cc393383c363f7c590c6ef714836f52a/xoxo.zip differ diff --git a/_downloads/d2379110fee2f2fbaf724f0142daaa8d/plotting.zip b/_downloads/d2379110fee2f2fbaf724f0142daaa8d/plotting.zip index d62c7f8de..f1ff926b4 100644 Binary files a/_downloads/d2379110fee2f2fbaf724f0142daaa8d/plotting.zip and b/_downloads/d2379110fee2f2fbaf724f0142daaa8d/plotting.zip differ diff --git a/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip b/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip index bb1b5e807..4b0e6609a 100644 Binary files a/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip and b/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip differ diff --git a/_images/sphx_glr_overlap_regridder_004.png b/_images/sphx_glr_overlap_regridder_004.png index 6077f7916..f090da163 100644 Binary files a/_images/sphx_glr_overlap_regridder_004.png and b/_images/sphx_glr_overlap_regridder_004.png differ diff --git a/_modules/xugrid/regrid/regridder.html b/_modules/xugrid/regrid/regridder.html index 8612bd6f6..829bc7f67 100644 --- a/_modules/xugrid/regrid/regridder.html +++ b/_modules/xugrid/regrid/regridder.html @@ -455,7 +455,7 @@

Source code for xugrid.regrid.regridder

 
                 if len(indices) > 0:
                     out[extra_index, target_index] = f(
-                        values, weights, workspace[extra_index, 1, :]
+                        values, weights, workspace[extra_index, 1, :n_value]
                     )
         return out
 
@@ -858,6 +858,7 @@ 

Source code for xugrid.regrid.regridder

 
     Any percentile method can be created via:
     ``method = OverlapRegridder.create_percentile_methode(percentile)``
+    See the examples.
 
     Parameters
     ----------
@@ -865,6 +866,13 @@ 

Source code for xugrid.regrid.regridder

     target: Ugrid2d, UgridDataArray
     method: str, function, optional
         Default value is ``"mean"``.
+
+    Examples
+    --------
+    Setup a custom percentile method and apply it:
+
+    >>> p33_3 = OverlapRegridder.create_percentile_method(33.3)
+    >>> regridder = OverlapRegridder(source, target, method=p33_3)
     """
 
     _JIT_FUNCTIONS = {
diff --git a/_sources/changelog.rst.txt b/_sources/changelog.rst.txt
index a23722067..76d87ef02 100644
--- a/_sources/changelog.rst.txt
+++ b/_sources/changelog.rst.txt
@@ -6,6 +6,31 @@ All notable changes to this project will be documented in this file.
 The format is based on `Keep a Changelog`_, and this project adheres to
 `Semantic Versioning`_.
 
+Unreleased
+----------
+
+Fixed
+~~~~~
+
+- The reduction methods for the overlap regridders now behave consistently when
+  all values are NaN or when all weights (overlaps) are zero, and all methods
+  give the same answer irrespective of the order in which the values are
+  encountered.
+  
+Added
+~~~~~
+
+- Percentiles (5, 10, 25, 50, 75, 90, 95) have been added to the
+  :class:`xugrid.OverlapRegridder` as standard available reduction methods
+  (available as ``"p5", "p10"``, etc.). Custom percentile values (e.g. 2.5, 42) can be
+  setup using :meth:`xugrid.OverlapRegridder.create_percentile_method`.
+  
+Changed
+~~~~~~~
+
+- Custom reduction functions provide to the overlap regridders no longer require
+  an ``indices`` argument.
+
 [0.11.0] 2024-08-05
 -------------------
 
diff --git a/_sources/examples-dev/sg_execution_times.rst.txt b/_sources/examples-dev/sg_execution_times.rst.txt
index e642045f0..0a37efefd 100644
--- a/_sources/examples-dev/sg_execution_times.rst.txt
+++ b/_sources/examples-dev/sg_execution_times.rst.txt
@@ -6,7 +6,7 @@
 
 Computation times
 =================
-**00:01.160** total execution time for 1 file **from examples-dev**:
+**00:01.146** total execution time for 1 file **from examples-dev**:
 
 .. container::
 
@@ -33,5 +33,5 @@ Computation times
      - Time
      - Mem (MB)
    * - :ref:`sphx_glr_examples-dev_voronoi.py` (``voronoi.py``)
-     - 00:01.160
+     - 00:01.146
      - 0.0
diff --git a/_sources/examples-dev/voronoi.rst.txt b/_sources/examples-dev/voronoi.rst.txt
index 12782ee2f..768e0c672 100644
--- a/_sources/examples-dev/voronoi.rst.txt
+++ b/_sources/examples-dev/voronoi.rst.txt
@@ -630,7 +630,7 @@ The figure shows:
 
 .. rst-class:: sphx-glr-timing
 
-   **Total running time of the script:** (0 minutes 1.160 seconds)
+   **Total running time of the script:** (0 minutes 1.146 seconds)
 
 
 .. _sphx_glr_download_examples-dev_voronoi.py:
diff --git a/_sources/examples/connectivity.rst.txt b/_sources/examples/connectivity.rst.txt
index 6d8bbaa72..3fba5cb25 100644
--- a/_sources/examples/connectivity.rst.txt
+++ b/_sources/examples/connectivity.rst.txt
@@ -129,7 +129,7 @@ By default, the border value for binary erosion is set to ``False`` (equal to
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -165,7 +165,7 @@ start by setting a single value in the center of the grid to ``True``.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -200,7 +200,7 @@ alternative border value:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -238,7 +238,7 @@ analyse connected parts of the mesh.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -272,7 +272,7 @@ Tesselation.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -316,7 +316,7 @@ the original.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -355,7 +355,7 @@ We can break down one of the Voronoi tesselations from above into triangles:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -409,7 +409,7 @@ the upper and lower parts:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -439,7 +439,7 @@ We can now use Laplace interpolation to fill the gaps in the grid.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -477,7 +477,7 @@ interpolation.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -518,7 +518,7 @@ To illustrate, let's take a look at the connectivity matrix of the Xoxo grid.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -554,14 +554,14 @@ locality:
  .. code-block:: none
 
 
-    
+    
 
 
 
 
 .. rst-class:: sphx-glr-timing
 
-   **Total running time of the script:** (0 minutes 1.388 seconds)
+   **Total running time of the script:** (0 minutes 1.403 seconds)
 
 
 .. _sphx_glr_download_examples_connectivity.py:
diff --git a/_sources/examples/overlap_regridder.rst.txt b/_sources/examples/overlap_regridder.rst.txt
index 3f47aa4fe..5f8596322 100644
--- a/_sources/examples/overlap_regridder.rst.txt
+++ b/_sources/examples/overlap_regridder.rst.txt
@@ -112,7 +112,7 @@ some bathymetry) of the Netherlands, and a coarser target grid.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -202,7 +202,7 @@ conservative methods, such as conductance:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -219,9 +219,9 @@ arguments: ``values``, ``indices``, ``weights``.
 
 * ``values``: is the array containing the (float) source values.
 * ``weights``: contains the (float) overlap between the target face and the
-  source faces. The size of ``weights`` is equal to the size of ``indices``.
-* ``work``: used as a temporary workspace. Contains one float value for each
-  index in indices.
+  source faces. The size of ``weights`` is equal to the size of ``values``.
+* ``work``: used as a temporary workspace of floats. The size of ``work`` is
+  equal to the size of ``values``.
 
 Xugrid regridder reduction functions are implemented in such a way. For a
 example, an area weighted sum could be implemented as follows:
@@ -237,7 +237,7 @@ example, an area weighted sum could be implemented as follows:
         weight_sum = 0.0
         for value, weight in zip(values, weights):
             if ~np.isnan(value):
-                total = +value * weight
+                total += value * weight
                 weight_sum += weight
         if weight_sum == 0.0:
             return np.nan
@@ -251,26 +251,30 @@ example, an area weighted sum could be implemented as follows:
 
 
 
-.. GENERATED FROM PYTHON SOURCE LINES 137-153
+.. GENERATED FROM PYTHON SOURCE LINES 137-157
 
 .. note::
    * Each reduction must return a single float.
-   * Custom reductions methods must be able to deal with NaN values as these
-     are commonly encountered in datasets as a "no data value".
+   * Always check for ``np.isnan(value)``: Custom reductions methods must be
+     able to deal with NaN values as these are commonly encountered in datasets
+     as a "no data value".
    * If Python features are used that are unsupported by Numba, you will get
-     somewhat obscure errors. In such a case, test your function with
-     synthetic values for ``values, weights, workspace``.
+     somewhat obscure errors. In such a case, ``numba.njit`` and test your
+     function separately with synthetic values for ``values, weights,
+     workspace``.
    * The ``workspace`` array is provided to avoid dynamic memory allocations.
      It is a an array of floats with the same size as ``values`` or
      ``weights``. You may freely allocate new arrays within the reduction
-     function but it will impact performance.
+     function but it will impact performance. (Methods such as mode or median
+     require a workspace.)
    * While we could have implemented a weighted mean as:
      ``np.nansum(values * weights) / np.nansum(weights)``, the function above
-     is efficiently compiled by Numba and does not allocate.
+     is efficiently compiled by Numba and does not allocate temporary arrays.
 
-To use our custom method, we provide at initialization of the OverlapRegridder:
+To use our custom method, we provide it at initialization of the
+OverlapRegridder:
 
-.. GENERATED FROM PYTHON SOURCE LINES 153-158
+.. GENERATED FROM PYTHON SOURCE LINES 157-162
 
 .. code-block:: Python
 
@@ -293,16 +297,16 @@ To use our custom method, we provide at initialization of the OverlapRegridder:
  .. code-block:: none
 
 
-    
+    
 
 
 
-.. GENERATED FROM PYTHON SOURCE LINES 159-161
+.. GENERATED FROM PYTHON SOURCE LINES 163-165
 
 Not every reduction uses the ``weights`` and ``workspace`` arguments. For
-example, a regular sum:
+example, a regular sum could only look at the values:
 
-.. GENERATED FROM PYTHON SOURCE LINES 161-167
+.. GENERATED FROM PYTHON SOURCE LINES 165-171
 
 .. code-block:: Python
 
@@ -319,9 +323,7 @@ example, a regular sum:
 
 
 
-.. GENERATED FROM PYTHON SOURCE LINES 168-175
-
-Always ensure that the function can deal with NaN values!
+.. GENERATED FROM PYTHON SOURCE LINES 172-177
 
 Custom percentiles
 ------------------
@@ -329,7 +331,7 @@ Custom percentiles
 Xugrid provides a number of predefined percentiles (5, 10, 25, 50, 75, 90,
 95). In case you need a different percentile value, you can use this utility:
 
-.. GENERATED FROM PYTHON SOURCE LINES 175-178
+.. GENERATED FROM PYTHON SOURCE LINES 177-180
 
 .. code-block:: Python
 
@@ -343,11 +345,11 @@ Xugrid provides a number of predefined percentiles (5, 10, 25, 50, 75, 90,
 
 
 
-.. GENERATED FROM PYTHON SOURCE LINES 179-180
+.. GENERATED FROM PYTHON SOURCE LINES 181-182
 
 Then, provide it as the regridder method as above:
 
-.. GENERATED FROM PYTHON SOURCE LINES 180-185
+.. GENERATED FROM PYTHON SOURCE LINES 182-187
 
 .. code-block:: Python
 
@@ -370,18 +372,18 @@ Then, provide it as the regridder method as above:
  .. code-block:: none
 
 
-    
+    
 
 
 
-.. GENERATED FROM PYTHON SOURCE LINES 186-187
+.. GENERATED FROM PYTHON SOURCE LINES 188-189
 
 .. _Numba: https://numba.pydata.org/
 
 
 .. rst-class:: sphx-glr-timing
 
-   **Total running time of the script:** (0 minutes 4.007 seconds)
+   **Total running time of the script:** (0 minutes 4.019 seconds)
 
 
 .. _sphx_glr_download_examples_overlap_regridder.py:
diff --git a/_sources/examples/partitioning.rst.txt b/_sources/examples/partitioning.rst.txt
index 38be65a50..6d938d179 100644
--- a/_sources/examples/partitioning.rst.txt
+++ b/_sources/examples/partitioning.rst.txt
@@ -76,7 +76,7 @@ into several parts.
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -145,7 +145,7 @@ We can easily plot this data to visualize the partitions:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -213,7 +213,7 @@ merge these partitions back into one whole for post-processing:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -275,7 +275,7 @@ data:
  .. code-block:: none
 
 
-    
+    
 
 
 
@@ -667,7 +667,7 @@ Note that partioning and merging does not preserve order!
     
<xarray.DataArray 'elevation' (mesh2d_nFaces: 5248)> Size: 5kB
     array([False, False, False, ..., False, False, False])
     Coordinates:
-      * mesh2d_nFaces  (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247
+ * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247


@@ -1066,9 +1066,9 @@ original topology. ``reindex_like`` looks at the coordinates of both Coordinates: mesh2d_face_x (mesh2d_nFaces) float64 42kB 2.388e+04 1.86e+05 ... 3.03e+04 mesh2d_face_y (mesh2d_nFaces) float64 42kB 3.648e+05 ... 3.964e+05 - * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247 + * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247

@@ -1470,9 +1470,9 @@ reorder the data after merging. Coordinates: mesh2d_face_x (mesh2d_nFaces) float64 42kB 2.388e+04 1.86e+05 ... 3.03e+04 mesh2d_face_y (mesh2d_nFaces) float64 42kB 3.648e+05 ... 3.964e+05 - * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247 + * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247

@@ -1489,7 +1489,7 @@ partitions. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 3.863 seconds) + **Total running time of the script:** (0 minutes 3.829 seconds) .. _sphx_glr_download_examples_partitioning.py: diff --git a/_sources/examples/plotting.rst.txt b/_sources/examples/plotting.rst.txt index 66b862e39..b8dea06cf 100644 --- a/_sources/examples/plotting.rst.txt +++ b/_sources/examples/plotting.rst.txt @@ -450,13 +450,13 @@ faces.
<xarray.Dataset> Size: 19kB
     Dimensions:        (mesh2d_nNodes: 217, mesh2d_nFaces: 384, mesh2d_nEdges: 600)
     Coordinates:
-      * mesh2d_nEdges  (mesh2d_nEdges) int64 5kB 0 1 2 3 4 5 ... 595 596 597 598 599
-      * mesh2d_nNodes  (mesh2d_nNodes) int64 2kB 0 1 2 3 4 5 ... 212 213 214 215 216
       * mesh2d_nFaces  (mesh2d_nFaces) int64 3kB 0 1 2 3 4 5 ... 379 380 381 382 383
+      * mesh2d_nNodes  (mesh2d_nNodes) int64 2kB 0 1 2 3 4 5 ... 212 213 214 215 216
+      * mesh2d_nEdges  (mesh2d_nEdges) int64 5kB 0 1 2 3 4 5 ... 595 596 597 598 599
     Data variables:
         node_z         (mesh2d_nNodes) float64 2kB 1.933 2.091 1.875 ... 5.688 7.491
         face_z         (mesh2d_nFaces) float64 3kB 1.737 1.918 2.269 ... 5.408 6.424
-        edge_z         (mesh2d_nEdges) float64 5kB 1.989 1.875 1.8 ... 4.909 6.544


  • @@ -611,7 +611,7 @@ Dataset and calling the :py:meth:`UgridDataArray.ugrid.plot()` method. .. code-block:: none - + @@ -646,7 +646,7 @@ the edges results in a different kind of plot: .. code-block:: none - + @@ -688,7 +688,7 @@ We can put them side by side to illustrate the differences: .. code-block:: none - + @@ -718,7 +718,7 @@ filled contours for data associated with the face dimension: .. code-block:: none - + @@ -749,7 +749,7 @@ We can also overlay this data with the edges: .. code-block:: none - + @@ -824,7 +824,7 @@ All these (2D) plots are illustrated here for completeness' sake: .. code-block:: none - + @@ -857,7 +857,7 @@ The ``surface`` methods generate 3D surface plots: .. code-block:: none - + @@ -891,7 +891,7 @@ used: .. code-block:: none - + @@ -927,7 +927,7 @@ take an xarray DataArray and a xugrid grid as arguments. .. code-block:: none - + @@ -963,14 +963,14 @@ somewhere in the unstructured topology, and plot the resulting timeseries: .. code-block:: none - [] + [] .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 12.146 seconds) + **Total running time of the script:** (0 minutes 12.478 seconds) .. _sphx_glr_download_examples_plotting.py: diff --git a/_sources/examples/quick_overview.rst.txt b/_sources/examples/quick_overview.rst.txt index 6b2d55128..74834def5 100644 --- a/_sources/examples/quick_overview.rst.txt +++ b/_sources/examples/quick_overview.rst.txt @@ -464,7 +464,7 @@ We'll start by fetching a dataset: elevation (node) float64 73kB ... depth (time, node) float64 4MB ... mesh2d int32 4B ... - face_node_connectivity (face, nmax_face) float64 405kB ...


  • @@ -919,7 +919,7 @@ separate the variables: * node (node) int64 73kB 0 1 2 3 4 5 6 ... 9134 9135 9136 9137 9138 9139 Data variables: elevation (node) float64 73kB ... - depth (time, node) float64 4MB ...


  • @@ -1361,7 +1361,7 @@ We can then grab one of the data variables as usual for xarray: Coordinates: node_x (node) float64 73kB ... node_y (node) float64 73kB ... - * node (node) int64 73kB 0 1 2 3 4 5 6 ... 9134 9135 9136 9137 9138 9139 + * node (node) int64 73kB 0 1 2 3 4 5 6 ... 9134 9135 9136 9137 9138 9139

    @@ -1771,7 +1771,7 @@ some data by hand here:
    <xarray.DataArray (mesh2d_nFaces: 2)> Size: 16B
         array([1., 2.])
         Coordinates:
    -      * mesh2d_nFaces  (mesh2d_nFaces) int64 16B 0 1
    + * mesh2d_nFaces (mesh2d_nFaces) int64 16B 0 1

    @@ -1809,7 +1809,7 @@ Plotting .. code-block:: none - + @@ -1860,7 +1860,7 @@ To select based on the topology, use the ``.ugrid`` attribute: .. code-block:: none - + @@ -2258,7 +2258,7 @@ Computation on DataArrays is unchanged from xarray:
    <xarray.DataArray (mesh2d_nFaces: 2)> Size: 16B
         array([11., 12.])
         Coordinates:
    -      * mesh2d_nFaces  (mesh2d_nFaces) int64 16B 0 1
    + * mesh2d_nFaces (mesh2d_nFaces) int64 16B 0 1

    @@ -2720,7 +2720,7 @@ Conversion from Geopandas is easy too: Coordinates: * mesh2d_nFaces (mesh2d_nFaces) int64 16B 0 1 Data variables: - test (mesh2d_nFaces) float64 16B 1.0 2.0 + test (mesh2d_nFaces) float64 16B 1.0 2.0

    @@ -3116,13 +3116,13 @@ grid (nodes, faces, edges).
    <xarray.Dataset> Size: 19kB
         Dimensions:        (mesh2d_nNodes: 217, mesh2d_nFaces: 384, mesh2d_nEdges: 600)
         Coordinates:
    -      * mesh2d_nEdges  (mesh2d_nEdges) int64 5kB 0 1 2 3 4 5 ... 595 596 597 598 599
    -      * mesh2d_nNodes  (mesh2d_nNodes) int64 2kB 0 1 2 3 4 5 ... 212 213 214 215 216
           * mesh2d_nFaces  (mesh2d_nFaces) int64 3kB 0 1 2 3 4 5 ... 379 380 381 382 383
    +      * mesh2d_nNodes  (mesh2d_nNodes) int64 2kB 0 1 2 3 4 5 ... 212 213 214 215 216
    +      * mesh2d_nEdges  (mesh2d_nEdges) int64 5kB 0 1 2 3 4 5 ... 595 596 597 598 599
         Data variables:
             node_z         (mesh2d_nNodes) float64 2kB 1.933 2.091 1.875 ... 5.688 7.491
             face_z         (mesh2d_nFaces) float64 3kB 1.737 1.918 2.269 ... 5.408 6.424
    -        edge_z         (mesh2d_nEdges) float64 5kB 1.989 1.875 1.8 ... 4.909 6.544
    • mesh2d_nFaces
      PandasIndex
      PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
    • mesh2d_nNodes
      PandasIndex
      PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
    • mesh2d_nEdges
      PandasIndex
      PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))


  • @@ -3634,7 +3634,7 @@ a grid object:
    <xarray.Dataset> Size: 0B
         Dimensions:  ()
         Data variables:
    -        *empty*
    + *empty*

    @@ -4029,7 +4029,7 @@ We can then add variables one-by-one, as we might with an xarray Dataset: node_y (node) float64 73kB ... * node (node) int64 73kB 0 1 2 3 4 5 6 ... 9134 9135 9136 9137 9138 9139 Data variables: - elevation (node) float64 73kB ... + elevation (node) float64 73kB ...

    @@ -4434,7 +4434,7 @@ before writing. elevation (node) float64 73kB ... depth (time, node) float64 4MB ... Attributes: - Conventions: CF-1.9 UGRID-1.0
  • Conventions :
    CF-1.9 UGRID-1.0


  • @@ -4495,7 +4495,7 @@ before writing. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.502 seconds) + **Total running time of the script:** (0 minutes 0.504 seconds) .. _sphx_glr_download_examples_quick_overview.py: diff --git a/_sources/examples/regridder_overview.rst.txt b/_sources/examples/regridder_overview.rst.txt index a5e5573f8..8376980ae 100644 --- a/_sources/examples/regridder_overview.rst.txt +++ b/_sources/examples/regridder_overview.rst.txt @@ -79,7 +79,7 @@ elevation of the Netherlands. .. code-block:: none - + @@ -151,7 +151,7 @@ the centroids of the new grid fall. .. code-block:: none - + @@ -182,7 +182,7 @@ Rexgrid provides the CentroidLocatorRegridder for this: .. code-block:: none - + @@ -217,7 +217,7 @@ so large. Let's try the OverlapOverregridder instead. .. code-block:: none - + @@ -249,7 +249,7 @@ Let's try again, now with the minimum: .. code-block:: none - + @@ -280,7 +280,7 @@ Or the maximum: .. code-block:: none - + @@ -709,7 +709,7 @@ result. mesh2d_face_x (mesh2d_nFaces) float64 42kB ... mesh2d_face_y (mesh2d_nFaces) float64 42kB ... * layer (layer) int64 40B 1 2 3 4 5 - * mesh2d_nFaces (mesh2d_nFaces) int64 42kB 0 1 2 3 4 ... 5244 5245 5246 5247
    • mesh2d_face_x
      (mesh2d_nFaces)
      float64
      ...
      standard_name :
      projection_x_coordinate
      [5248 values with dtype=float64]
    • mesh2d_face_y
      (mesh2d_nFaces)
      float64
      ...
      standard_name :
      projection_y_coordinate
      [5248 values with dtype=float64]
    • layer
      (layer)
      int64
      1 2 3 4 5
      array([1, 2, 3, 4, 5])
    • mesh2d_nFaces
      (mesh2d_nFaces)
      int64
      0 1 2 3 4 ... 5244 5245 5246 5247
      array([   0,    1,    2, ..., 5245, 5246, 5247])
    • layer
      PandasIndex
      PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
    • mesh2d_nFaces
      PandasIndex
      PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))


  • @@ -1151,7 +1151,7 @@ all additional dimensions. -45.92794405, -39.50867478]]) Coordinates: * layer (layer) int64 40B 1 2 3 4 5 - * mesh2d_nFaces (mesh2d_nFaces) int64 784B 0 1 2 3 4 5 ... 92 93 94 95 96 97
    • layer
      PandasIndex
      PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
    • mesh2d_nFaces
      PandasIndex
      PandasIndex(RangeIndex(start=0, stop=98, step=1, name='mesh2d_nFaces'))


  • @@ -1233,7 +1233,7 @@ and the aggregated mean. .. code-block:: none - [, , , , ] + [, , , , ] @@ -1270,7 +1270,7 @@ To illustrate, we will zoom in to a part of the Netherlands. .. code-block:: none - + @@ -1323,7 +1323,7 @@ the triangles. .. code-block:: none - + @@ -1364,7 +1364,7 @@ the regridders work for any collection of (convex) faces. .. code-block:: none - + @@ -1400,7 +1400,7 @@ is kept the same. .. code-block:: none - + @@ -1416,7 +1416,7 @@ is kept the same. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 8.133 seconds) + **Total running time of the script:** (0 minutes 8.168 seconds) .. _sphx_glr_download_examples_regridder_overview.py: diff --git a/_sources/examples/selection.rst.txt b/_sources/examples/selection.rst.txt index 86cd9c208..981ce9e98 100644 --- a/_sources/examples/selection.rst.txt +++ b/_sources/examples/selection.rst.txt @@ -85,7 +85,7 @@ elevation of the Netherlands. .. code-block:: none - + @@ -130,7 +130,7 @@ A subset of the unstructured grid is returned by using slices without a step: .. code-block:: none - + @@ -161,7 +161,7 @@ In such a case the entire grid is returned. .. code-block:: none - + @@ -196,7 +196,7 @@ This means we can easily select along a single dimension: .. code-block:: none - + @@ -226,7 +226,7 @@ Or, using ``None`` if we only care about the start: .. code-block:: none - + @@ -660,7 +660,7 @@ Two values will select a point: mesh2d_x (mesh2d_nFaces) float64 8B 1.5e+05 mesh2d_y (mesh2d_nFaces) float64 8B 4.63e+05 Attributes: - unit: m NAP + unit: m NAP

    @@ -1066,7 +1066,7 @@ of six points: mesh2d_x (mesh2d_nFaces) float64 48B 1.25e+05 1.5e+05 ... 1.75e+05 mesh2d_y (mesh2d_nFaces) float64 48B 4e+05 4e+05 ... 4.65e+05 4.65e+05 Attributes: - unit: m NAP + unit: m NAP

    @@ -1472,7 +1472,7 @@ To select points without broadcasting, use ``.ugrid.sel_points`` instead: mesh2d_x (mesh2d_nFaces) float64 24B 1.25e+05 1.5e+05 1.75e+05 mesh2d_y (mesh2d_nFaces) float64 24B 4e+05 4.3e+05 4.65e+05 Attributes: - unit: m NAP + unit: m NAP

    @@ -1876,9 +1876,9 @@ We can sample points along a line as well by providing slices **with** a step: mesh2d_x (mesh2d_nFaces) float64 80B 1e+05 1.1e+05 ... 1.8e+05 1.9e+05 mesh2d_y (mesh2d_nFaces) float64 80B 4.65e+05 4.65e+05 ... 4.65e+05 Attributes: - unit: m NAP + unit: m NAP

    @@ -2284,7 +2284,7 @@ Two slices with a step results in broadcasting: mesh2d_x (mesh2d_nFaces) float64 800B 1e+05 1.1e+05 ... 1.9e+05 mesh2d_y (mesh2d_nFaces) float64 800B 4e+05 4e+05 ... 4.9e+05 4.9e+05 Attributes: - unit: m NAP
  • unit :
    m NAP


  • @@ -2738,15 +2738,15 @@ As well as a slice with a step and multiple values: mesh2d_x (mesh2d_nFaces) float64 160B 1e+05 1.1e+05 ... 1.9e+05 mesh2d_y (mesh2d_nFaces) float64 160B 4e+05 4e+05 ... 4.3e+05 4.3e+05 Attributes: - unit: m NAP
  • unit :
    m NAP


  • @@ -2930,7 +2930,7 @@ thousands faces: .. code-block:: none - + @@ -2952,7 +2952,7 @@ face dimension for 2D topologies. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 3.611 seconds) + **Total running time of the script:** (0 minutes 3.576 seconds) .. _sphx_glr_download_examples_selection.py: diff --git a/_sources/examples/sg_execution_times.rst.txt b/_sources/examples/sg_execution_times.rst.txt index 75d335905..87f28a315 100644 --- a/_sources/examples/sg_execution_times.rst.txt +++ b/_sources/examples/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:49.940** total execution time for 8 files **from examples**: +**00:50.611** total execution time for 8 files **from examples**: .. container:: @@ -33,26 +33,26 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_examples_vector_conversion.py` (``vector_conversion.py``) - - 00:16.290 + - 00:16.634 - 0.0 * - :ref:`sphx_glr_examples_plotting.py` (``plotting.py``) - - 00:12.146 + - 00:12.478 - 0.0 * - :ref:`sphx_glr_examples_regridder_overview.py` (``regridder_overview.py``) - - 00:08.133 + - 00:08.168 - 0.0 * - :ref:`sphx_glr_examples_overlap_regridder.py` (``overlap_regridder.py``) - - 00:04.007 + - 00:04.019 - 0.0 * - :ref:`sphx_glr_examples_partitioning.py` (``partitioning.py``) - - 00:03.863 + - 00:03.829 - 0.0 * - :ref:`sphx_glr_examples_selection.py` (``selection.py``) - - 00:03.611 + - 00:03.576 - 0.0 * - :ref:`sphx_glr_examples_connectivity.py` (``connectivity.py``) - - 00:01.388 + - 00:01.403 - 0.0 * - :ref:`sphx_glr_examples_quick_overview.py` (``quick_overview.py``) - - 00:00.502 + - 00:00.504 - 0.0 diff --git a/_sources/examples/vector_conversion.rst.txt b/_sources/examples/vector_conversion.rst.txt index 871c6a948..6393b0767 100644 --- a/_sources/examples/vector_conversion.rst.txt +++ b/_sources/examples/vector_conversion.rst.txt @@ -73,7 +73,7 @@ We'll once again use the surface elevation data example. .. code-block:: none - + @@ -518,9 +518,9 @@ GeoDataFrame. Data variables: elevation (mesh2d_nFaces) float32 21kB 1.17 9.81 54.04 ... -15.83 -0.45 mesh2d_face_x (mesh2d_nFaces) float64 42kB 2.388e+04 1.86e+05 ... 3.03e+04 - mesh2d_face_y (mesh2d_nFaces) float64 42kB 3.648e+05 ... 3.964e+05 + mesh2d_face_y (mesh2d_nFaces) float64 42kB 3.648e+05 ... 3.964e+05

    @@ -582,7 +582,7 @@ burn into the grid. .. code-block:: none - + @@ -978,9 +978,9 @@ we want to compute the average surface elevation per province: Coordinates: * id (id) float64 96B 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 Attributes: - unit: m NAP
    • id
      (id)
      float64
      0.0 1.0 2.0 3.0 ... 9.0 10.0 11.0
      array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11.])
    • id
      PandasIndex
      PandasIndex(Index([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0], dtype='float64', name='id'))
  • unit :
    m NAP


  • @@ -1087,7 +1087,7 @@ We can also use such "masks" to e.g. modify specific parts of the grid data: .. code-block:: none - + @@ -1233,7 +1233,7 @@ burn operation. .. code-block:: none - + @@ -1342,7 +1342,7 @@ compare to the grid faces. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 16.290 seconds) + **Total running time of the script:** (0 minutes 16.634 seconds) .. _sphx_glr_download_examples_vector_conversion.py: diff --git a/_sources/sample_data/adh_san_diego.rst.txt b/_sources/sample_data/adh_san_diego.rst.txt index 82c9553ac..08a267c2d 100644 --- a/_sources/sample_data/adh_san_diego.rst.txt +++ b/_sources/sample_data/adh_san_diego.rst.txt @@ -41,7 +41,7 @@ It contains a static dataset (bed elevation) and a time varying dataset .. code-block:: none - + @@ -71,7 +71,7 @@ It contains a static dataset (bed elevation) and a time varying dataset .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.293 seconds) + **Total running time of the script:** (0 minutes 0.297 seconds) .. _sphx_glr_download_sample_data_adh_san_diego.py: diff --git a/_sources/sample_data/disk.rst.txt b/_sources/sample_data/disk.rst.txt index a62ec165e..23713a480 100644 --- a/_sources/sample_data/disk.rst.txt +++ b/_sources/sample_data/disk.rst.txt @@ -39,7 +39,7 @@ of a disk. It contains data on the nodes, faces, and edges. .. code-block:: none - + @@ -68,7 +68,7 @@ of a disk. It contains data on the nodes, faces, and edges. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.139 seconds) + **Total running time of the script:** (0 minutes 0.138 seconds) .. _sphx_glr_download_sample_data_disk.py: diff --git a/_sources/sample_data/elevation_nl.rst.txt b/_sources/sample_data/elevation_nl.rst.txt index 31549b36a..ad2b18ec4 100644 --- a/_sources/sample_data/elevation_nl.rst.txt +++ b/_sources/sample_data/elevation_nl.rst.txt @@ -39,7 +39,7 @@ of the Netherlands. .. code-block:: none - [] + [] @@ -67,7 +67,7 @@ of the Netherlands. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.742 seconds) + **Total running time of the script:** (0 minutes 0.752 seconds) .. _sphx_glr_download_sample_data_elevation_nl.py: diff --git a/_sources/sample_data/provinces_nl.rst.txt b/_sources/sample_data/provinces_nl.rst.txt index c9d9c6d28..fb3130273 100644 --- a/_sources/sample_data/provinces_nl.rst.txt +++ b/_sources/sample_data/provinces_nl.rst.txt @@ -58,7 +58,7 @@ Netherlands, including water, presented as geopandas GeoDataFrame. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.065 seconds) + **Total running time of the script:** (0 minutes 0.066 seconds) .. _sphx_glr_download_sample_data_provinces_nl.py: diff --git a/_sources/sample_data/sg_execution_times.rst.txt b/_sources/sample_data/sg_execution_times.rst.txt index 1c833a17b..6bfeaa743 100644 --- a/_sources/sample_data/sg_execution_times.rst.txt +++ b/_sources/sample_data/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:01.293** total execution time for 5 files **from sample_data**: +**00:01.307** total execution time for 5 files **from sample_data**: .. container:: @@ -33,16 +33,16 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_sample_data_elevation_nl.py` (``elevation_nl.py``) - - 00:00.742 + - 00:00.752 - 0.0 * - :ref:`sphx_glr_sample_data_adh_san_diego.py` (``adh_san_diego.py``) - - 00:00.293 + - 00:00.297 - 0.0 * - :ref:`sphx_glr_sample_data_disk.py` (``disk.py``) - - 00:00.139 + - 00:00.138 - 0.0 * - :ref:`sphx_glr_sample_data_provinces_nl.py` (``provinces_nl.py``) - - 00:00.065 + - 00:00.066 - 0.0 * - :ref:`sphx_glr_sample_data_xoxo.py` (``xoxo.py``) - 00:00.054 diff --git a/_sources/sg_execution_times.rst.txt b/_sources/sg_execution_times.rst.txt index daf453850..8319e2589 100644 --- a/_sources/sg_execution_times.rst.txt +++ b/_sources/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:52.393** total execution time for 14 files **from all galleries**: +**00:53.064** total execution time for 14 files **from all galleries**: .. container:: @@ -33,43 +33,43 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_examples_vector_conversion.py` (``../examples/vector_conversion.py``) - - 00:16.290 + - 00:16.634 - 0.0 * - :ref:`sphx_glr_examples_plotting.py` (``../examples/plotting.py``) - - 00:12.146 + - 00:12.478 - 0.0 * - :ref:`sphx_glr_examples_regridder_overview.py` (``../examples/regridder_overview.py``) - - 00:08.133 + - 00:08.168 - 0.0 * - :ref:`sphx_glr_examples_overlap_regridder.py` (``../examples/overlap_regridder.py``) - - 00:04.007 + - 00:04.019 - 0.0 * - :ref:`sphx_glr_examples_partitioning.py` (``../examples/partitioning.py``) - - 00:03.863 + - 00:03.829 - 0.0 * - :ref:`sphx_glr_examples_selection.py` (``../examples/selection.py``) - - 00:03.611 + - 00:03.576 - 0.0 * - :ref:`sphx_glr_examples_connectivity.py` (``../examples/connectivity.py``) - - 00:01.388 + - 00:01.403 - 0.0 * - :ref:`sphx_glr_examples-dev_voronoi.py` (``../examples-dev/voronoi.py``) - - 00:01.160 + - 00:01.146 - 0.0 * - :ref:`sphx_glr_sample_data_elevation_nl.py` (``../data/examples/elevation_nl.py``) - - 00:00.742 + - 00:00.752 - 0.0 * - :ref:`sphx_glr_examples_quick_overview.py` (``../examples/quick_overview.py``) - - 00:00.502 + - 00:00.504 - 0.0 * - :ref:`sphx_glr_sample_data_adh_san_diego.py` (``../data/examples/adh_san_diego.py``) - - 00:00.293 + - 00:00.297 - 0.0 * - :ref:`sphx_glr_sample_data_disk.py` (``../data/examples/disk.py``) - - 00:00.139 + - 00:00.138 - 0.0 * - :ref:`sphx_glr_sample_data_provinces_nl.py` (``../data/examples/provinces_nl.py``) - - 00:00.065 + - 00:00.066 - 0.0 * - :ref:`sphx_glr_sample_data_xoxo.py` (``../data/examples/xoxo.py``) - 00:00.054 diff --git a/api/xugrid.OverlapRegridder.html b/api/xugrid.OverlapRegridder.html index 56a75336d..2de22c528 100644 --- a/api/xugrid.OverlapRegridder.html +++ b/api/xugrid.OverlapRegridder.html @@ -683,7 +683,8 @@

    xugrid.OverlapRegridderCustom aggregation functions are also supported, if they can be compiled by Numba. See the User Guide.

    Any percentile method can be created via: -method = OverlapRegridder.create_percentile_methode(percentile)

    +method = OverlapRegridder.create_percentile_methode(percentile) +See the examples.

    Parameters:
    +

    Examples

    +

    Setup a custom percentile method and apply it:

    +
    >>> p33_3 = OverlapRegridder.create_percentile_method(33.3)
    +>>> regridder = OverlapRegridder(source, target, method=p33_3)
    +
    +
    __init__(source: UgridDataArray, target: UgridDataArray, method: str | Callable = 'mean')[source]#
    diff --git a/changelog.html b/changelog.html index f5484216c..eee9a6104 100644 --- a/changelog.html +++ b/changelog.html @@ -664,11 +664,39 @@

    ChangelogKeep a Changelog, and this project adheres to Semantic Versioning.

    -
    -

    [0.11.0] 2024-08-05#

    +
    +

    Unreleased#

    Fixed#

      +
    • The reduction methods for the overlap regridders now behave consistently when +all values are NaN or when all weights (overlaps) are zero, and all methods +give the same answer irrespective of the order in which the values are +encountered.

    • +
    +
    +
    +

    Added#

    +
      +
    • Percentiles (5, 10, 25, 50, 75, 90, 95) have been added to the +xugrid.OverlapRegridder as standard available reduction methods +(available as "p5", "p10", etc.). Custom percentile values (e.g. 2.5, 42) can be +setup using xugrid.OverlapRegridder.create_percentile_method().

    • +
    +
    +
    +

    Changed#

    +
      +
    • Custom reduction functions provide to the overlap regridders no longer require +an indices argument.

    • +
    +
    +
    +
    +

    [0.11.0] 2024-08-05#

    +
    +

    Fixed#

    +
    • xugrid.merge_partitions() now automatically merges chunks (if defined in the partition datasets). This removes the commonly seen PerformanceWarning: Slicing with an out-of-order index is generating ... @@ -683,8 +711,8 @@

      Fixed#< linestring locations, but wrong line indexes.

    -
    -

    Added#

    +
    +

    Added#

    • Included edge_node_connectivity in xugrid.Ugrid2d.from_meshkernel(), so the ordering of edges is consistent with meshkernel.

    • @@ -697,8 +725,8 @@

      Added#< aggregated properties to grid edges.

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    [0.10.0] 2024-05-01#

    -
    -

    Fixed#

    +
    +

    [0.10.0] 2024-05-01#

    +
    +

    Fixed#

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    [0.9.0] 2024-02-15#

    -
    -

    Fixed#

    +
    +

    [0.9.0] 2024-02-15#

    +
    +

    Fixed#

    • xugrid.Ugrid2d.equals() and xugrid.Ugrid1d.equals() test if dataset is equal instead of testing type.

    • @@ -747,8 +775,8 @@

      Fixed#

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    [0.8.1] 2024-01-19#

    -
    -

    Fixed#

    +
    +

    [0.8.1] 2024-01-19#

    +
    +

    Fixed#

    • xugrid.UgridDataArrayAccessor.reindex_like() will now take the tolerance argument into account before sorting. In the past, near ties could be resolved differently between otherwise similar grid topologies due to roundoff.

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    [0.8.0] 2023-12-11#

    -
    -

    Changed#

    +
    +

    [0.8.0] 2023-12-11#

    +
    +

    Changed#

    • Initialize Meshkernel with a spherical projection if the coordinate reference system (crs) is geographic.

    • @@ -820,20 +848,20 @@

      Changed#

    -
    -

    [0.7.1] 2023-11-17#

    -
    -

    Fixed#

    +
    +

    [0.7.1] 2023-11-17#

    +
    +

    Fixed#

    • Support for Meshkernel 3 (#171). Initialize Meshkernel with defaults, setting it to cartesian projection.

    -
    -

    [0.7.0] 2023-10-19#

    -
    -

    Added#

    +
    +

    [0.7.0] 2023-10-19#

    +
    +

    Added#

    -
    -

    Changed#

    +
    +

    Changed#

    • UGRID 2D topologies are no longer automatically forced in counterclockwise orientation during initialization.

    -
    -

    Fixed#

    +
    +

    Fixed#

    -
    -

    [0.6.5] 2023-09-30#

    -
    -

    Added#

    +
    +

    [0.6.5] 2023-09-30#

    +
    +

    Added#

    -
    -

    Changed#

    +
    +

    Changed#

    • Selection operations along a line, or at point locations, will now prefix the name of the grid in the x and y coordinates. This avoids name collisions when @@ -898,8 +926,8 @@

      Changed# parts of xarray were used which no longer existed.

    -
    -

    Fixed#

    +
    +

    Fixed#

    • xugrid.UgridDatasetAccessor.sel() would return only a single grid topology even when the selection subject contains more than one grid. It now @@ -907,20 +935,20 @@

      Fixed#

    -
    -

    [0.6.4] 2023-08-22#

    -
    -

    Fixed#

    +
    +

    [0.6.4] 2023-08-22#

    +
    +

    Fixed#

    -
    -

    [0.6.3] 2023-08-12#

    -
    -

    Added#

    +
    +

    [0.6.3] 2023-08-12#

    +
    +

    Added#

    • Added xugrid.burn_vector_geometries() to burn vector geometries in the form of geopandas GeoDataFrames into a Ugrid2d topology.

    • @@ -946,8 +974,8 @@

      Added#

    -
    -

    Fixed#

    +
    +

    Fixed#

    -
    -

    Changed#

    +
    +

    Changed#

    • Initializing a Ugrid2d topology with an invalid edge_node_connectivity will no longer raise an error.

    • @@ -977,10 +1005,10 @@

      Changed#

    -
    -

    [0.6.2] 2023-07-26#

    -
    -

    Fixed#

    +
    +

    [0.6.2] 2023-07-26#

    +
    +

    Fixed#

    • Computing indexer to avoid dask array of unknown shape upon plotting. See #117.

    • @@ -991,20 +1019,20 @@

      Fixed#

    -
    -

    [0.6.1] 2023-07-07#

    -
    -

    Fixed#

    +
    +

    [0.6.1] 2023-07-07#

    +
    +

    Fixed#

    • Fillvalue was not properly replaced in cast. See #113.

    -
    -

    [0.6.0] 2023-07-05#

    -
    -

    Added#

    +
    +

    [0.6.0] 2023-07-05#

    +
    +

    Added#

    -
    -

    Fixed#

    +
    +

    Fixed#

    • Regridding is possible again with regridders initiated from_weights. See #90. @@ -1036,18 +1064,18 @@

      Fixed#

      Fixed numba typing error for regridders.

    -
    -

    Changed#

    +
    +

    Changed#

    • Regridding structured grids now throws error if computed weights < 0.0 or > 1.0, before these weights were clipped to 0.0 and 1.0 respectively.

    -
    -

    [0.5.0] 2023-05-25#

    -
    -

    Added#

    +
    +

    [0.5.0] 2023-05-25#

    +
    +

    Added#

    -
    -

    [0.4.0] 2023-05-05#

    -
    -

    Fixed#

    +
    +

    [0.4.0] 2023-05-05#

    +
    +

    Fixed#

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    [0.3.0] 2023-03-14#

    -
    -

    Fixed#

    +
    +

    [0.3.0] 2023-03-14#

    +
    +

    Fixed#

    -
    -

    Changed#

    +
    +

    Changed#

    • pygeos has been replaced by shapely >= 2.0.

    • xugrid.snap_to_grid() will now return a UgridDataset and a geopandas @@ -1126,18 +1154,18 @@

      Changed# negative data.

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    [0.2.1] 2023-02-06#

    -
    -

    Fixed#

    +
    +

    [0.2.1] 2023-02-06#

    +
    +

    Fixed#

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    Added#

    +
    +

    Added#

    • Several regridding methods have been added for face associated data: xugrid.BarycentricInterpolator have been added to interpolate @@ -1164,10 +1192,10 @@

      Added#

    -
    -

    [0.2.0] 2023-01-19#

    -
    -

    Fixed#

    +
    +

    [0.2.0] 2023-01-19#

    +
    +

    Fixed#

    -
    -

    Changed#

    +
    +

    Changed#

    • Forwarding to the internal xarray object is now setup at class definition of UgridDataArray and UgridDataset rather than at runtime. @@ -1216,8 +1244,8 @@

      Changed# only a left or right neighbor).

    -
    -

    Added#

    +
    +

    Added#

    • xugrid.Ugrid1d and xugrid.Ugrid2d can now be initialized with an attrs argument to setup non-default UGRID attributes such as @@ -1237,28 +1265,28 @@

      Added#

    -
    -

    [0.1.10] 2022-12-13#

    -
    -

    Fixed#

    +
    +

    [0.1.10] 2022-12-13#

    +
    +

    Fixed#

    • Move matplotlib import into a function body so matplotlib remains an optional dependency.

    -
    -

    [0.1.9] 2022-12-13#

    -
    -

    Changed#

    +
    +

    [0.1.9] 2022-12-13#

    +
    +

    Changed#

    • Warn instead of error when the UGRID attributes indicate a set of coordinate that are not present in the dataset.

    • Use pyproject.toml for setuptools instead of setup.cfg.

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    Fixed#

    +
    +

    Fixed#

    -
    -

    [0.1.7] 2022-09-06#

    -
    -

    Fixed#

    +
    +

    [0.1.7] 2022-09-06#

    +
    +

    Fixed#

    • The setitem method of xugrid.UgridDataset has been updated to check the dimensions of grids rather than the dimensions of objects to decide @@ -1301,25 +1329,25 @@

      Fixed#

    -
    -

    [0.1.5] 2022-08-22#

    -
    -

    Fixed#

    +
    +

    [0.1.5] 2022-08-22#

    +
    +

    Fixed#

    • list and dict type annotations have been replaced with List and Dict from the typing module to support older versions of Python (<3.9).

    -
    -

    Changed#

    +
    +

    Changed#

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    [0.1.4] 2022-08-16#

    -
    -

    Fixed#

    +
    +

    [0.1.4] 2022-08-16#

    +
    +

    Fixed#

    • A start_index of 1 in connectivity arrays is handled and will no longer result in indexing errors.

    • levels argument is now respected in line and pcolormesh plotting methods.

    -
    -

    Changed#

    +
    +

    Changed#

    • UGRID variables are now extracted via xugrid.UgridRolesAccessor to allow for multiple UGRID topologies in a single dataset.

    • @@ -1371,8 +1399,8 @@

      Changed# instead, which can check for consistency with the xarray object.

    -
    -

    Added#

    +
    +

    Added#

    -
    -

    [0.1.3] 2021-12-23#

    +
    +

    [0.1.3] 2021-12-23#

    @@ -1439,128 +1467,134 @@

    [0.1.3] 2021-12-23

    @@ -972,7 +972,7 @@

    UgridDataArrayuda.ugrid.plot() -plotting
    -plotting -plotting

    @@ -1105,7 +1105,7 @@

    Additional Arguments
    ds["face_z"].ugrid.plot(cmap="RdBu", levels=8, yincrease=False)
     
    -plotting
    <matplotlib.collections.PolyCollection object at 0x7f30b1e0a9c0>
    +plotting
    <matplotlib.collections.PolyCollection object at 0x7f583d923aa0>
     

    @@ -1119,7 +1119,7 @@

    As a functionxugrid.plot.pcolormesh(grid, da) -plotting
    <matplotlib.collections.PolyCollection object at 0x7f30a8d2aea0>
    +plotting
    <matplotlib.collections.PolyCollection object at 0x7f583d923410>
     

    @@ -1133,10 +1133,10 @@

    Xarray DataArray plotsdepth.isel(node=1000).plot() -node_x = 4.84e+05, node_y = 3.614e+06, node = 1000

    @@ -2134,7 +2134,7 @@

    Data selectionsubset.ugrid.plot() -quick overview
    <matplotlib.collections.PolyCollection object at 0x7f30b1ee6660>
    +quick overview
    <matplotlib.collections.PolyCollection object at 0x7f583e809340>
     
    @@ -2517,7 +2517,7 @@

    ComputationTotal running time of the script: (0 minutes 0.502 seconds)

    +

    Total running time of the script: (0 minutes 0.504 seconds)

    -regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f30a90df230>
    +regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f583d8ed2e0>
     

    Xugrid provides several “regridder” classes which can convert gridded data @@ -490,7 +490,7 @@

    CentroidLocatorRegridderax.scatter(*grid.centroids.T, color="red")

    -regridder overview -regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f30a80c6030>
    +regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f583cb89b20>
     

    @@ -512,7 +512,7 @@

    OverlapRegriddermean.ugrid.plot(vmin=-20, vmax=90, cmap="terrain", edgecolor="red") -regridder overview -regridder overview -regridder overview -regridder overview
    [<matplotlib.lines.Line2D object at 0x7f30a8c4e120>, <matplotlib.lines.Line2D object at 0x7f30a8c4d340>, <matplotlib.lines.Line2D object at 0x7f30a8c4e390>, <matplotlib.lines.Line2D object at 0x7f30a8c4c170>, <matplotlib.lines.Line2D object at 0x7f30a8c4fe60>]
    +regridder overview
    [<matplotlib.lines.Line2D object at 0x7f583dee5e80>, <matplotlib.lines.Line2D object at 0x7f583dee4470>, <matplotlib.lines.Line2D object at 0x7f583dee65d0>, <matplotlib.lines.Line2D object at 0x7f583dee5fa0>, <matplotlib.lines.Line2D object at 0x7f583dee6cf0>]
     

    @@ -1429,7 +1429,7 @@

    BarycentricInterpolatorpart.ugrid.plot(vmin=-20, vmax=90, cmap="terrain") -regridder overview -regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f30a8ed9a60>
    +regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f58469643e0>
     

    @@ -1464,7 +1464,7 @@

    Arbitrary gridsvoronoi_grid.plot(ax=ax, color="red") -regridder overview
    <matplotlib.collections.LineCollection object at 0x7f30b2cfcda0>
    +regridder overview
    <matplotlib.collections.LineCollection object at 0x7f583e031430>
     

    @@ -1478,10 +1478,10 @@

    Re-use#result.ugrid.plot(vmin=-20, vmax=90, cmap="terrain") -regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f30a820a9c0>
    +regridder overview
    <matplotlib.collections.PolyCollection object at 0x7f583cd46060>
     
    -

    Total running time of the script: (0 minutes 8.133 seconds)

    +

    Total running time of the script: (0 minutes 8.168 seconds)

    -selection -selection -selection -selection -selection
    <matplotlib.collections.PolyCollection object at 0x7f30b2a4e2d0>
    +selection
    <matplotlib.collections.PolyCollection object at 0x7f583e4a72c0>
     

    @@ -922,7 +922,7 @@

    Point selection.ugrid.sel_points instead:

    @@ -1692,7 +1692,7 @@

    Point selectionsubset.ugrid.plot(vmin=-20, vmax=90, cmap="terrain", aspect=1, size=5) -selection
    <matplotlib.collections.PolyCollection object at 0x7f30a9135460>
    +selection
    <matplotlib.collections.PolyCollection object at 0x7f583d87ac30>
     

    For a 2D topology, selecting faces by an index always results in a valid @@ -2983,7 +2983,7 @@

    Index selectionTotal running time of the script: (0 minutes 3.611 seconds)

    +

    Total running time of the script: (0 minutes 3.576 seconds)