Changelog#

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.

[0.10.0] 2024-05-01#

Fixed#

Added#

  • xugrid.earcut_triangulate_polygons() and xugrid.Ugrid2d.earcut_triangulate_polygons() have been added to break down polygon geodataframes into a triangular mesh for further processing.

  • xugrid.OverlapRegridder.weights_as_dataframe() has been added to extract regridding weights (overlaps) from the regridders. This method is also available for BarycentricInterpolator, CentroidLocatorRegridder, and RelativeOverlapRegridder.

[0.9.0] 2024-02-15#

Fixed#

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

  • Fixed bug in xugrid.concat() and xugrid.merge() where multiple grids were returned if grids did not point to the same object id (i.e. copies).

  • Fixed bug in xugrid.Ugrid1d.merge_partitions(), which caused ValueError: indexes must be provided for attrs.

  • Fixed from_structured methods: the generated faces are now always in counterclockwise direction, also for increasing y-coordinates or decreasing x-coordinates.

Added#

  • xugrid.Ugrid2d.from_structured_multicoord() has been added to generate UGRID topologies from rotated or approximated curvilinear grids.

  • xugrid.Ugrid2d.from_structured_intervals1d() has been added to generate UGRID topologies from “intervals”: the N + 1 vertex coordinates for N faces.

  • xugrid.Ugrid2d.from_structured_intervals2d() has been added to generate UGRID topologies from “intervals”: the (M + 1, N + 1) vertex coordinates for N faces.

  • xugrid.UgridDataArrayAccessor.from_structured() now takes x and y arguments to specify which coordinates to use as the UGRID x and y coordinates.

  • xugrid.UgridDataset.sizes as an alternative to xugrid.UgridDataset.dimensions

  • xugrid.Ugrid2d.max_face_node_dimension which returns the dimension name designating nodes per face.

  • xugrid.AbstractUgrid.max_connectivity_sizes which returns all maximum connectivity dimensions and their corresponding size.

  • xugrid.AbstractUgrid.max_connectivity_dimensions which returns all maximum connectivity dimensions.

Changed#

[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#

Changed#

[0.8.0] 2023-12-11#

Changed#

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

  • Minimum Python version increased to 3.9.

[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#

Changed#

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

Fixed#

  • Using an index which only reorders but does not change the size in xugrid.Ugrid1d.topology_subset() or xugrid.Ugrid2d.topology_subset() would erroneously result in the original grid being returned, rather than a new grid with the faces or edges shuffled. This breaks the link the between topology and data when using .isel on a UgridDataset or UgridDataArray. This has been fixed: both data and the topology are now shuffled accordingly.

[0.6.5] 2023-09-30#

Added#

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 multiple topologies are present in a dataset.

  • Xugrid now contains a partial copy of the xarray plot utils module, and its tests. The latest xarray release broke xugrid (on import), since (private) parts of xarray were used which no longer existed.

Fixed#

  • xugrid.UgridDatasetAccessor.sel() would return only a single grid topology even when the selection subject contains more than one grid. It now correctly returns subsets of all topologies.

[0.6.4] 2023-08-22#

Fixed#

[0.6.3] 2023-08-12#

Added#

Fixed#

Changed#

[0.6.2] 2023-07-26#

Fixed#

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

  • Bug where chunked dask arrays could not be regridded. See #119.

  • Bug where error was thrown in the RelativeOverlapRegridder upon flipping the y coordinate.

[0.6.1] 2023-07-07#

Fixed#

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

[0.6.0] 2023-07-05#

Added#

Fixed#

  • Regridding is possible again with regridders initiated from_weights. See #90. This was a broken feature in the 0.5.0 release.

  • Computed weights for structured grids regridders now decrease with distance instead of increase.

  • Fixed edge case for regridding structured grids, where midpoints of the source and target grid are equal.

  • Fixed numba typing error for regridders.

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.4.0] 2023-05-05#

Fixed#

Changed#

  • xugrid.Ugrid2d.sel_points() and xugrid.UgridDataArrayAccessor.sel_points() now return a result with an “index” coordinate, containing the (integer) index of the points.

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

  • 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#

[0.3.0] 2023-03-14#

Fixed#

Changed#

Added#

[0.2.1] 2023-02-06#

Fixed#

  • xugrid.open_dataarray() will now return 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: xugrid.BarycentricInterpolator have been added to interpolate smoothly, xugrid.CentroidLocatorRegridder has been added to simply sample based on face centroid, and xugrid.OverlapRegridder supports may aggregation methods (e.g. area weighted mean).

  • Added xugrid.Ugrid1d.edge_node_coordinates.

  • Added xugrid.Ugrid2d.edge_node_coordinates and xugrid.Ugrid2d.face_node_coordinates.

[0.2.0] 2023-01-19#

Fixed#

Changed#

  • Forwarding to the internal xarray object is now setup at class definition of UgridDataArray and UgridDataset rather than at runtime. This means tab completion and docstrings for the xarray methods should work.

  • The UGRID dimensions in UgridDataArray and UgridDataset are labelled at initialization. This allows us to track necessary changes to the UGRID topology for general xarray operations. Forwarded methods (such as 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).

  • xugrid.Ugrid1d.sel() and 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.

  • xugrid.Ugrid1d.dimensions and xugrid.Ugrid2d.dimensions will now return a dictionary with the keys the dimension names and as the values the sizes of the dimensions.

  • 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#

  • xugrid.Ugrid1d and xugrid.Ugrid2d can now be initialized with an attrs argument to setup non-default UGRID attributes such as alternative node, edge, or face dimensions.

  • xugrid.Ugrid1d.topology_subset(), xugrid.Ugrid2d.topology_subset(), xugrid.Ugrid1d.isel(), and xugrid.Ugrid2d.isel() now take a return_index argument and will to return UGRID dimension indexes if set to True.

  • xugrid.UgridDataArrayAccessor.clip_box() and 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: UgridDataArray, UgridDataset, UgridDataArrayAccessor, and UgridDatasetAccessor.

  • Added xugrid.merge_partitions() to merge topology and data that have been partitioned along UGRID dimensions.

[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#

  • 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#

Fixed#

[0.1.7] 2022-09-06#

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#

Added#

[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#

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

  • Extraction of the UGRID dimensions now proceeds via the dummy variable attributes, the connetivity arrays, and finally the coordinates.

  • Multiple coordinates can be supported. The UgridRolesAccessor attempts to infer valid node coordinates based on their standard names (one of``projection_x_coordinate, projection_y_coordinate, longitude, latitude``); a warning is raised when these are not found.

  • xugrid.UgridDataset now supports multiple Ugrid topologies. Consequently, its .grid attribute has been replaced by .grids.

  • The xarray object is no longer automatically wrapped when accessing the .obj attribute of a UgridDataArray or UgridDataset.

  • Separate UgridAccessors have been created for UgridDataArray and UgridDataset as many methods are specific to one but not the other.

  • The Ugrid classes have been subtly changed to support multiple topologies in a dataset. The .dataset attribute has been renamed to ._dataset, as access to the dataset should occur via the .to_dataset() method instead, which can check for consistency with the xarray object.

Added#

[0.1.3] 2021-12-23#