diff --git a/.doctrees/api/xugrid.BarycentricInterpolator.doctree b/.doctrees/api/xugrid.BarycentricInterpolator.doctree index dd3f05aa..46bcb11b 100644 Binary files a/.doctrees/api/xugrid.BarycentricInterpolator.doctree and b/.doctrees/api/xugrid.BarycentricInterpolator.doctree differ diff --git a/.doctrees/api/xugrid.CentroidLocatorRegridder.doctree b/.doctrees/api/xugrid.CentroidLocatorRegridder.doctree index e5a0eb73..405f28fb 100644 Binary files a/.doctrees/api/xugrid.CentroidLocatorRegridder.doctree and b/.doctrees/api/xugrid.CentroidLocatorRegridder.doctree differ diff --git a/.doctrees/api/xugrid.OverlapRegridder.doctree b/.doctrees/api/xugrid.OverlapRegridder.doctree index f603952c..bca6139c 100644 Binary files a/.doctrees/api/xugrid.OverlapRegridder.doctree and b/.doctrees/api/xugrid.OverlapRegridder.doctree differ diff --git a/.doctrees/api/xugrid.RelativeOverlapRegridder.doctree b/.doctrees/api/xugrid.RelativeOverlapRegridder.doctree index 0553da67..2ead8312 100644 Binary files a/.doctrees/api/xugrid.RelativeOverlapRegridder.doctree and b/.doctrees/api/xugrid.RelativeOverlapRegridder.doctree differ diff --git a/.doctrees/changelog.doctree b/.doctrees/changelog.doctree index 7f44a841..0594f2b1 100644 Binary files a/.doctrees/changelog.doctree and b/.doctrees/changelog.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 1bd53a2a..a3099a18 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 aad79f42..3b9308da 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 05ab6ae4..d0f54976 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 8feb0642..91c82620 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 2542000f..a3e853ca 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 3bef7f69..7506428c 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 554ac38f..f8905b41 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 641a777e..7a5f5f13 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 8cef032b..35b2c6f0 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 5e78bacc..22573777 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 bfe9e6c3..6c745ff5 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 d699cfb4..c0b3c41a 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 79b8ba8f..33e1773e 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 f2d473f3..f2bceca4 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 7c983979..a7a8c3f1 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 57674f2f..a5eb1b33 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 d1ef77a7..8e3c4044 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 81882c9e..b8a1b115 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 779efef0..e79c4677 100644 Binary files a/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip and b/_downloads/1da8bbc63e9e34158260eadd1533549c/quick_overview.zip differ diff --git a/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip b/_downloads/2dbba5ebb6d2057d196983a008981162/voronoi.zip index 135a5dfb..fc65e2a2 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 a73521ad..466ffc07 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 9d80a172..c1e105d5 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 27eec741..160e448f 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 7a733824..d99631dd 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 41065694..ba857aad 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 1814532e..ffc59e75 100644 Binary files a/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip and b/_downloads/90d50f8fc21b6ec5d818d26f7955df8a/overlap_regridder.zip differ diff --git a/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip b/_downloads/97eabe2c66fc9328b1e51f27fdee52f6/partitioning.zip index 13baa0fc..3f6d8bfc 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 b6dcea9c..4fa9072b 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 badf5618..0a552b01 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 9f5e08fd..b1625c41 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 f9247e79..bf83d0b7 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 de310af5..232dc1ad 100644 Binary files a/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip and b/_downloads/f25be90ee220882246ef4778e276e863/vector_conversion.zip differ diff --git a/_modules/xugrid/regrid/regridder.html b/_modules/xugrid/regrid/regridder.html index f0953bcb..1affcf0b 100644 --- a/_modules/xugrid/regrid/regridder.html +++ b/_modules/xugrid/regrid/regridder.html @@ -600,7 +600,7 @@
)
return out
- def regrid(self, object) -> UgridDataArray:
+ def regrid(self, data: Union[xr.DataArray, UgridDataArray]) -> UgridDataArray:
"""
Regrid the data from a DataArray from its old grid topology to the new
target topology.
@@ -611,7 +611,7 @@ Source code for xugrid.regrid.regridder
Parameters
----------
- object: UgridDataArray or xarray.DataArray
+ data: UgridDataArray or xarray.DataArray
Returns
-------
@@ -624,17 +624,21 @@ Source code for xugrid.regrid.regridder
# But it causes problems with initializing a regridder
# from_dataset, because the name has been changed to
# __source_nFace.
- if isinstance(object, UgridDataArray):
- obj = object.ugrid.obj
- source_dims = (object.ugrid.grid.face_dimension,)
- else:
- obj = object
+ if isinstance(data, xr.DataArray):
+ obj = data
source_dims = ("y", "x")
+ elif isinstance(data, UgridDataArray):
+ obj = data.ugrid.obj
+ source_dims = (data.ugrid.grid.face_dimension,)
+ else:
+ raise TypeError(
+ f"Expected DataArray or UgridDataAray, received: {type(data).__name__}"
+ )
- missing_dims = set(source_dims).difference(object.dims)
+ missing_dims = set(source_dims).difference(data.dims)
if missing_dims:
raise ValueError(
- f"object does not contain regridder source dimensions: {missing_dims}"
+ f"data does not contain regridder source dimensions: {missing_dims}"
)
regridded = self.regrid_dataarray(obj, source_dims)
diff --git a/_sources/changelog.rst.txt b/_sources/changelog.rst.txt
index a56f084e..e61e3ce7 100644
--- a/_sources/changelog.rst.txt
+++ b/_sources/changelog.rst.txt
@@ -19,6 +19,11 @@ 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
~~~~~
@@ -26,6 +31,14 @@ 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
-------------------
diff --git a/_sources/examples-dev/sg_execution_times.rst.txt b/_sources/examples-dev/sg_execution_times.rst.txt
index cebe0868..ea4f526e 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.313** total execution time for 1 file **from examples-dev**:
+**00:01.333** 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.313
+ - 00:01.333
- 0.0
diff --git a/_sources/examples-dev/voronoi.rst.txt b/_sources/examples-dev/voronoi.rst.txt
index b8dd5eb3..339c1020 100644
--- a/_sources/examples-dev/voronoi.rst.txt
+++ b/_sources/examples-dev/voronoi.rst.txt
@@ -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:
diff --git a/_sources/examples/connectivity.rst.txt b/_sources/examples/connectivity.rst.txt
index 40d5ff70..b3242487 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.366 seconds)
+ **Total running time of the script:** (0 minutes 1.375 seconds)
.. _sphx_glr_download_examples_connectivity.py:
diff --git a/_sources/examples/overlap_regridder.rst.txt b/_sources/examples/overlap_regridder.rst.txt
index 07078bd1..c54f1c2a 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
-
+
@@ -298,7 +298,7 @@ OverlapRegridder:
.. code-block:: none
-
+
@@ -373,7 +373,7 @@ Then, provide it as the regridder method as above:
.. code-block:: none
-
+
@@ -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:
diff --git a/_sources/examples/partitioning.rst.txt b/_sources/examples/partitioning.rst.txt
index da02f7ab..92453721 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
-
+
@@ -673,7 +673,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
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
<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
<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
PandasIndex(RangeIndex(start=0, stop=384, step=1, name='mesh2d_nFaces'))
PandasIndex(RangeIndex(start=0, stop=600, step=1, name='mesh2d_nEdges'))
PandasIndex(RangeIndex(start=0, stop=217, step=1, name='mesh2d_nNodes'))
<xarray.Dataset> Size: 0B Dimensions: () Data variables: - *empty*+ *empty*
[5248 values with dtype=float64]
[5248 values with dtype=float64]
array([1, 2, 3, 4, 5])
array([ 0, 1, 2, ..., 5245, 5246, 5247])
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
PandasIndex(RangeIndex(start=0, stop=5248, step=1, name='mesh2d_nFaces'))
PandasIndex(Index([1, 2, 3, 4, 5], dtype='int64', name='layer'))
PandasIndex(RangeIndex(start=0, stop=98, step=1, name='mesh2d_nFaces'))
array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.])
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'))
from_weights
(weights, target)
regrid
(object)
regrid
(data)
Regrid the data from a DataArray from its old grid topology to the new target topology.
regrid_dataarray
(source, source_dims)
from_weights
(weights, target)
regrid
(object)
regrid
(data)
Regrid the data from a DataArray from its old grid topology to the new target topology.
regrid_dataarray
(source, source_dims)
from_weights
(weights, target[, method])
regrid
(object)
regrid
(data)
Regrid the data from a DataArray from its old grid topology to the new target topology.
regrid_dataarray
(source, source_dims)
from_weights
(weights, target[, method])
regrid
(object)
regrid
(data)
Regrid the data from a DataArray from its old grid topology to the new target topology.
regrid_dataarray
(source, source_dims)
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
+xugrid.CentroidLocatorRegridder
, xugrid.OverlapRegridder
,
+xugrid.RelativeOverlapRegridder
, and
+xugrid.BarycentricInterpolator
has been renamed. The method now
+takes a data
argument instead of object
.
The .regrid
methods of xugrid.CentroidLocatorRegridder
,
+xugrid.OverlapRegridder
, xugrid.RelativeOverlapRegridder
,
+and xugrid.BarycentricInterpolator
now raise a TypeError if an
+inappropriate type is provided.
Release 0.12.0 changed the return type of the face node connectivity of
xugrid.Ugrid2d.voronoi_topology
from a scipy.sparse.coo_matrix to
@@ -721,8 +735,8 @@
xugrid.UgridDatasetAccessor.to_netcdf()
.xugrid.Ugrid1d
and xugrid.Ugrid2d
now take an optional
start_index
which controls the start index for the UGRID connectivity
@@ -734,8 +748,8 @@
xugrid.Ugrid1d
and xugrid.Ugrid2d
will generally preserve
the fill value and start index of grids when roundtripping from and to xarray
@@ -747,10 +761,10 @@
The xugrid.BarycentricInterpolator
now interpolates according to
linear weights within the full bounds of the source grid, rather than only
@@ -759,8 +773,8 @@
xugrid.CentroidLocatorRegridder
xugrid.UgridDataArrayAccessor.interpolate_na()
has been added to fill missing
data. Currently, the only supported method is "nearest"
.
Selection operations such as UgridDataArrayAccessor.sel_points()
will
now also return points that are located on the edges of 2D topologies.
The regridders will no longer flip around data along an axis when regridding from data from structured to unstructured form when the coordinates along the @@ -798,8 +812,8 @@
y
midpoints, and dx
along x
.)xugrid.snap_nodes()
to snap neighboring vertices together that are
located within a maximum snapping distance from each other. If vertices are
@@ -811,10 +825,10 @@
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 @@ -829,8 +843,8 @@
Percentiles (5, 10, 25, 50, 75, 90, 95) have been added to the
xugrid.OverlapRegridder
as standard available reduction methods
@@ -838,8 +852,8 @@
xugrid.OverlapRegridder.create_percentile_method()
.Custom reduction functions provide to the overlap regridders no longer require
an indices
argument.
xugrid.merge_partitions()
now automatically merges chunks (if defined
in the partition datasets). This removes the commonly seen
@@ -873,8 +887,8 @@
Included edge_node_connectivity
in xugrid.Ugrid2d.from_meshkernel()
,
so the ordering of edges is consistent with meshkernel
.
xugrid.UgridDataArrayAccessor.laplace_interpolate()
now uses rtol
and atol
keywords instead of tol
, to match changes in
@@ -896,10 +910,10 @@
Fixed indexing bug in the "mode"
method in
xugrid.CentroidLocatorRegridder
, xugrid.OverlapRegridder
,
@@ -907,8 +921,8 @@
xugrid.earcut_triangulate_polygons()
and
xugrid.Ugrid2d.earcut_triangulate_polygons()
have been added to break
@@ -920,10 +934,10 @@
xugrid.Ugrid2d.equals()
and xugrid.Ugrid1d.equals()
test if
dataset is equal instead of testing type.
xugrid.Ugrid2d.from_structured_multicoord()
has been added
to generate UGRID topologies from rotated or approximated curvilinear grids.
xugrid.Ugrid2d.from_structured()
now takes x
and y
arguments instead
of x_bounds
and y_bounds
arguments.
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.
xugrid.UgridDataArrayAccessor.laplace_interpolate()
now also supports
interpolation of node associated data, and Ugrid1d topologies.
xugrid.UgridDataArrayAccessor.laplace_interpolate()
no longer uses scipy’s
ILU decomposition as a preconditioner. A simpler and more effective preconditioner
@@ -999,10 +1013,10 @@
Initialize Meshkernel with a spherical projection if the coordinate reference system (crs) is geographic.
Support for Meshkernel 3 (#171). Initialize Meshkernel with defaults, setting it to cartesian projection.
xugrid.Ugrid2d.to_nonperiodic()
,
xugrid.UgridDataArrayAccessor.to_nonperiodic()
and
@@ -1043,15 +1057,15 @@
UGRID 2D topologies are no longer automatically forced in counterclockwise orientation during initialization.
Using an index which only reorders but does not change the size in
xugrid.Ugrid1d.topology_subset()
or
@@ -1063,10 +1077,10 @@
xugrid.Ugrid2d.intersect_line()
,
xugrid.Ugrid2d.intersect_linestring()
@@ -1077,8 +1091,8 @@
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 @@ -1088,8 +1102,8 @@
xugrid.UgridDatasetAccessor.sel()
would return only a single grid
topology even when the selection subject contains more than one grid. It now
@@ -1097,20 +1111,20 @@
Bug in xugrid.snap_to_grid()
, which caused an IndexError
.
See #122.
Added xugrid.burn_vector_geometries()
to burn vector geometries in the
form of geopandas GeoDataFrames into a Ugrid2d topology.
xugrid.CentroidLocatorRegridder
, xugrid.OverlapRegridder
,
and xugrid.BarycentricInterpolator
will now also regrid structured
@@ -1153,8 +1167,8 @@
Initializing a Ugrid2d topology with an invalid edge_node_connectivity will no longer raise an error.
Computing indexer to avoid dask array of unknown shape upon plotting. See #117.
Fillvalue was not properly replaced in cast. See #113.
xugrid.Ugrid2d.label_partitions()
, xugrid.Ugrid2d.partition()
,
xugrid.Ugrid2d.merge_partitions()
have been added to partition and merge
@@ -1213,8 +1227,8 @@
xugrid.Ugrid1d.contract_vertices()
has been added.
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.
xugrid.BarycentricInterpolator
,
xugrid.CentroidLocatorRegridder
, xugrid.OverlapRegridder
,
@@ -1246,10 +1260,10 @@
xugrid.Ugrid2d.tesselate_centroidal_voronoi()
and
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
will only include
@@ -1261,8 +1275,8 @@
geopandas
was missing in the environment.xugrid.Ugrid2d.sel_points()
and
xugrid.UgridDataArrayAccessor.sel_points()
now return a result with an
@@ -1275,8 +1289,8 @@
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
has been added to
provide orthogonal voronoi cells for triangular grids.
pygeos
has been replaced by shapely >= 2.0
.
xugrid.snap_to_grid()
will now return a UgridDataset and a geopandas
@@ -1316,18 +1330,18 @@
xugrid.Ugrid2d.tesselate_circumcenter_voronoi()
has been added to
provide orthogonal voronoi cells for triangular grids.
xugrid.open_dataarray()
will now return xugrid.UgridDataArray
instead of only an xarray DataArray without topology.
Several regridding methods have been added for face associated data:
xugrid.BarycentricInterpolator
have been added to interpolate
@@ -1354,10 +1368,10 @@
xugrid.Ugrid1d.topology_subset()
,
xugrid.Ugrid2d.topology_subset()
, and therefore also
@@ -1379,8 +1393,8 @@
Forwarding to the internal xarray object is now setup at class definition of
UgridDataArray
and UgridDataset
rather than at runtime.
@@ -1406,8 +1420,8 @@
xugrid.Ugrid1d
and xugrid.Ugrid2d
can now be initialized
with an attrs
argument to setup non-default UGRID attributes such as
@@ -1427,28 +1441,28 @@
Move matplotlib import into a function body so matplotlib remains an optional dependency.
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.
xugrid.Ugrid1d.edge_bounds
has been added to get the bounds
for every edge contained in the grid.
xugrid.UgridDataArray.from_structured()
will no longer result in
a flipped grid when the structured coordintes are not ascending.
The setitem method of xugrid.UgridDataset
has been updated to check
the dimensions of grids rather than the dimensions of objects to decide
@@ -1491,25 +1505,25 @@
list
and dict
type annotations have been replaced with List
and Dict
from the typing module to support older versions of Python (<3.9).
The inplace
argument has been removed from xugrid.Ugrid1d.to_crs()
and xugrid.Ugrid2d.to_crs()
; A copy is returned when the CRS is already
as requested.
xugrid.UgridDataArrayAccessor.set_crs()
has been added to set the CRS.
xugrid.UgridDataArrayAccessor.to_crs()
has been added to reproject the
@@ -1528,18 +1542,18 @@
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.
UGRID variables are now extracted via xugrid.UgridRolesAccessor
to
allow for multiple UGRID topologies in a single dataset.
xugrid.UgridRolesAccessor
has been added to extract UGRID variables
from xarray Datasets.