------------------
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.