Xugrid

Latest version: v0.12.1

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

Scan your dependencies

Page 4 of 5

0.5.0

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

Added
~~~~~

- :class:`xugrid.BarycentricInterpolator`,
:class:`xugrid.CentroidLocatorRegridder`, :class:`xugrid.OverlapRegridder`,
and :class:`RelativeOverlapRegridder`, now accept structured grids, in the
form of a ``xr.DataArray`` with a ``"x"`` and a ``"y"`` coordinate.

0.4.0

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

Fixed
~~~~~

- :meth:`xugrid.Ugrid2d.tesselate_centroidal_voronoi` and
:meth:`xugrid.Ugrid2d.tesselate_circumcenter_voronoi` will only include
relevant centroids, rather than all the original centroids when
``add_exterior=False``. Previously, a scrambled voronoi grid could result
from the tesselation when the original grid contained cells with only one
neighbor.
- ``import xugrid`` now does not throw ``ImportError`` anymore when the
optional package ``geopandas`` was missing in the environment.

Changed
~~~~~~~

- :meth:`xugrid.Ugrid2d.sel_points` and
:meth:`xugrid.UgridDataArrayAccessor.sel_points` now return a result with an
"index" coordinate, containing the (integer) index of the points.
- :class:`xugrid.Ugrid2d` will now error during initialization if the
node_edge_connectivity is invalid (i.e. contains nodes that are not used in
any face).
- :meth:`xugrid.UgridDataArrayAccessor.plot.pcolormesh` now defaults to
``edgecolors="face"`` to avoid white lines (which can be become relatively
dominant in when plotting large grids).

Added
~~~~~

- :meth:`xugrid.Ugrid2d.tesselate_circumcenter_voronoi` has been added to
provide orthogonal voronoi cells for triangular grids.
- :meth:`xugrid.Ugrid1d.to_dataset`, :meth:`xugrid.Ugrid2d.to_dataset`,
:meth:`xugrid.UgridDataArrayAccessor.to_dataset`, and
:meth:`xugrid.UgridDatasetAccessor.to_dataset` now take an
``optional_attributes`` keyword argument to generate the optional UGRID
attributes.
- :class:`xugrid.Ugrid1d` and :class:`xugrid.Ugrid2d` now have an ``attrs``
property.
- :meth:`xugrid.UgridDatasetAccessor.rasterize` and
:meth:`xugrid.UgridDatasetAccessor.rasterize_like` have been added to
rasterize all face variables in a UgridDataset.

0.3.0

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

Fixed
~~~~~

Changed
~~~~~~~

- ``pygeos`` has been replaced by ``shapely >= 2.0``.
- :func:`xugrid.snap_to_grid` will now return a UgridDataset and a geopandas
GeoDataFrame. The UgridDataset contains the snapped data on the edges of the
the UGRID topology.
- :class:`xugrid.RelativeOverlapRegridder` has been created to separate the
relative overlap logic from :class:`xugrid.OverlapRegridder`.
- :class:`xugrid.BarycentricInterpolator`,
:class:`xugrid.CentroidLocatorRegridder`, :class:`xugrid.OverlapRegridder`,
and :class:`RelativeOverlapRegridder` can now be instantiated from weights
(``.from_weights``) or from a dataset (``.from_dataset``) containing
pre-computed weights.
- Regridder classes initiated with method *geometric_mean* now return NaNs for
negative data.

Added
~~~~~

- :func:`xugrid.Ugrid2d.tesselate_circumcenter_voronoi` has been added to
provide orthogonal voronoi cells for triangular grids.

0.2.1

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

Fixed
~~~~~
- :func:`xugrid.open_dataarray` will now return :class:`xugrid.UgridDataArray`
instead of only an xarray DataArray without topology.
- Setting wrapped properties of the xarray object (such as ``name``) now works.
- Creating new (subset) topologies via e.g. selection will no longer error when
datasets contains multiple coordinates systems (such as both longitude and
latitude next to projected x and y coordinates).

Changed
~~~~~~~

Added
~~~~~

- Several regridding methods have been added for face associated data:
:class:`xugrid.BarycentricInterpolator` have been added to interpolate
smoothly, :class:`xugrid.CentroidLocatorRegridder` has been added to simply
sample based on face centroid, and :class:`xugrid.OverlapRegridder` supports
may aggregation methods (e.g. area weighted mean).
- Added :attr:`xugrid.Ugrid1d.edge_node_coordinates`.
- Added :attr:`xugrid.Ugrid2d.edge_node_coordinates` and
:attr:`xugrid.Ugrid2d.face_node_coordinates`.

0.2.0

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

Fixed
~~~~~

- :meth:`xugrid.Ugrid1d.topology_subset`,
:meth:`xugrid.Ugrid2d.topology_subset`, and therefore also
:meth:`xugrid.UgridDataArrayAccessor.sel` and
:meth:`xugrid.UgridDatasetAccessor.sel` now propagate UGRID attributes.
Before this fix, dimension of the UGRID topology would go out of sync with
the DataArray, as a subset would return a new UGRID topology with default
UGRID names.
- :meth:`xugrid.Ugrid2d.topology_subset`, :meth:`xugrid.UgridDataArrayAccessor.sel`
:meth:`xugrid.UgridDatasetAccessor.sel` will now return a correct UGRID 2D
topology when fill values are present in the face node connectivity.
- :meth:`xugrid.plot.contour` and :meth:`xugrid.plot.contourf` will no longer
plot erratic contours when "island" faces are present (no connections to
other faces) or when "slivers" are present (where cells have a only a left or
right neighbor).
- :meth:`xugrid.plot.pcolormesh` will draw all edges around faces now when
edgecolor is defined, rather than skipping some edges.
- Do not mutate edge_node_connectivity in UGRID2D when the
face_node_connectivity property is accessed.

Changed
~~~~~~~

- Forwarding to the internal xarray object is now setup at class definition of
:class:`UgridDataArray` and :class:`UgridDataset` rather than at runtime.
This means tab completion and docstrings for the xarray methods should work.
- The UGRID dimensions in :class:`UgridDataArray` and :class:`UgridDataset` are
labelled at initialization. This allows us to track necessary changes to the
UGRID topology for general xarray operations. Forwarded methods (such as
:meth:`UgridDataArray.isel`) will now create a subset topology if possible, or
error if an invalid topology is created by the selection.
- This also means that selection on one facet of the grid (e.g. the face
dimension) will also result in a valid selection of the data on another facet
(such as the edge dimension).
- :meth:`xugrid.Ugrid1d.sel` and :meth:`xugrid.Ugrid2d.sel` now take an ``obj``
argument and return a DataArray or Dataset.
- Consequently, `xugrid.UgridDataArrayAccessor.isel` and
`xugrid.UgridDatasetAccessor.isel` have been removed.
- :attr:`xugrid.Ugrid1d.dimensions` and
:attr:`xugrid.Ugrid2d.dimensions` will now return a dictionary with the
keys the dimension names and as the values the sizes of the dimensions.
- :attr:`xugrid.Ugrid2d.voronoi_topology` will now include exterior vertices to
also generate a valid 2D topology when when "island" faces are present (no
connections to other faces) or when "slivers" are present (where cells have a
only a left or right neighbor).

Added
~~~~~

- :class:`xugrid.Ugrid1d` and :class:`xugrid.Ugrid2d` can now be initialized
with an ``attrs`` argument to setup non-default UGRID attributes such as
alternative node, edge, or face dimensions.
- :meth:`xugrid.Ugrid1d.topology_subset`,
:meth:`xugrid.Ugrid2d.topology_subset`, :meth:`xugrid.Ugrid1d.isel`, and
:meth:`xugrid.Ugrid2d.isel` now take a ``return_index`` argument and will
to return UGRID dimension indexes if set to True.
- :meth:`xugrid.UgridDataArrayAccessor.clip_box` and
:meth:`xugrid.UgridDatasetAccessor.clip_box` have been added to more easily
select data in a bounding box.
- For convenience, ``.grid``, ``.grids``, ``.obj`` properties are now available
on all these classes: :class:`UgridDataArray`, :class:`UgridDataset`,
:class:`UgridDataArrayAccessor`, and :class:`UgridDatasetAccessor`.
- Added :func:`xugrid.merge_partitions` to merge topology and data that have
been partitioned along UGRID dimensions.

0.1.10

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

Fixed
~~~~~

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

Page 4 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.