Xugrid

Latest version: v0.12.1

Safety actively analyzes 701533 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

1.0.0

.. _Semantic Versioning: https://semver.org/spec/v2.0.0.html

0.12.1

-------------------

Fixed
~~~~~

0.12.0

-------------------

Fixed
~~~~~

- The :class:`xugrid.BarycentricInterpolator` now interpolates according to
linear weights within the full bounds of the source grid, rather than only
within the centroids of the source grid. Previously, it would give no results
beyond the centroids for structured to structured regridding, and it would
give nearest results (equal to :class:`xugrid.CentroidLocatorRegridder`) otherwise.

Added
~~~~~

- :meth:`xugrid.UgridDataArrayAccessor.interpolate_na` has been added to fill missing
data. Currently, the only supported method is ``"nearest"``.
- :attr:`xugrid.Ugrid1.dims` and :attr:`xugrid.Ugrid2.dims` have been added to
return a set of the UGRID dimensions.
- :meth:`xugrid.UgridDataArrayAccessor.laplace_interpolate` now uses broadcasts
over non-UGRID dimensions and support lazy evaluation.

Changed
~~~~~~~

- Selection operations such as :meth:`UgridDataArrayAccessor.sel_points` will
now also return points that are located on the edges of 2D topologies.
- :attr:`xugrid.Ugrid1d.dimensions` and :attr:`xugrid.Ugrid2d.dimensions` now
raise a FutureWarning; use ``.dims`` or ``.sizes`` instead.
- Improved performance of :func:`xugrid.open_dataset` and
:func:`xugrid.merge_partitions` when handling datasets with a large number
of variables (>100).

0.11.2

-------------------

Fixed
~~~~~

- 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
dimensions is decreasing. (Decreasing y-axis is a common occurence in
geospatial rasters.)
- The regridders will no longer error on ``.regrid()`` if a structured target
grid is non-equidistant, and contains an array delta (``d``) coordinate
rather than a single delta to denote cell sizes along a dimension (i.e.
``dy`` along ``y`` midpoints, and ``dx`` along ``x``.)

Added
~~~~~

- :func:`xugrid.snap_nodes` to snap neighboring vertices together that are
located within a maximum snapping distance from each other. If vertices are
located within a maximum distance, some of them are snapped to their
neighbors ("targets"), thereby guaranteeing a minimum distance between nodes
in the result. The determination of whether a point becomes a target itself
or gets snapped to another point is primarily based on the order in which
points are processed and their spatial relationships.

0.11.1

-------------------

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.
- :meth:`xugrid.merge_partitions` will now raise a ValueError if zero
partitions are provided.
- :meth:`xugrid.merge_partitions` will no longer error when chunks are
inconsistent across variables in a dataset, but now returns a merged dataset
while keeping the chunking per variable. (Note that if chunks are inconstent
for a variable **across partitions** that they are still and always unified
for the variable.)

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.
- :meth:`xugrid.Ugrid2d.sel_points`,
:meth:`xugrid.UgridDataArrayAccessor.sel_points` and
:meth:`xugrid.UgridDatasetAccessor.sel_points` now take an ``out_of_bounds``
and ``fill_value`` argument to determine what to with points that do not fall
inside of any grid feature. Previously, the method silently dropped these
points. The method now takes a ``fill_value`` argument to assign to
out-of-bounds points. It gives a warning return uses ``fill_value=np.nan`` by
default. To enable the old behavior, set ``out_of_bounds="drop"``.

0.11.0

-------------------

Fixed
~~~~~

- :func:`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 ...
times more chunks`` warning in subsequent operations, and also greatly
improves the performance of subsequent operations (roughly scaling linearly
with the number of partitions). The previous behavior can be maintained by
setting ``merge_ugrid_chunks=False``. This keyword will likely be deprecated
in the future as merging the UGRID dimension chunks should be superior for
(almost all?) subsquent operations.
- :func:`xugrid.snap_to_grid` now returns proper line indexes when multiple
linestrings are snapped. Snapping previously could result in correct
linestring locations, but wrong line indexes.

Added
~~~~~

- Included ``edge_node_connectivity`` in :meth:`xugrid.Ugrid2d.from_meshkernel`,
so the ordering of edges is consistent with ``meshkernel``.
- Added :meth:`xugrid.Ugrid1d.create_data_array`,
:meth:`xugrid.Ugrid2d.create_data_array`, and
:meth:`xugrid.UgridDataArray.from_data` to more easily instantiate a
UgridDataArray from a grid topology and an array of values.
- Added :func:`xugrid.create_snap_to_grid_dataframe` to provide
more versatile snapping, e.g. with custom reductions to assign_edge_coords
aggregated properties to grid edges.

Changed
~~~~~~~

- :meth:`xugrid.UgridDataArrayAccessor.laplace_interpolate` now uses ``rtol``
and ``atol`` keywords instead of ``tol``, to match changes in
``scipy.linalg.sparse.cg``.

Page 1 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.