From a395d6dbad7281343159904a4fd09fa31f6263db Mon Sep 17 00:00:00 2001 From: erogluorhan Date: Wed, 12 Aug 2026 09:21:12 -0600 Subject: [PATCH 1/2] Change substring matching to use of constants --- uxarray/remap/spatial_coords_remap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uxarray/remap/spatial_coords_remap.py b/uxarray/remap/spatial_coords_remap.py index 05f6f5e8e..c8142480a 100644 --- a/uxarray/remap/spatial_coords_remap.py +++ b/uxarray/remap/spatial_coords_remap.py @@ -3,6 +3,7 @@ import xarray as xr +from uxarray.conventions.ugrid import EDGE_DIM, FACE_DIM, NODE_DIM from uxarray.core.dataarray import UxDataArray from uxarray.errors import DimensionError from uxarray.grid.grid import Grid @@ -180,12 +181,11 @@ def _get_element_type_from_dimension(self, dim_name: str) -> Optional[str]: Optional[str] Element type ('nodes', 'faces', 'edges') or None """ - dim_lower = dim_name.lower() - if "face" in dim_lower: + if dim_name == FACE_DIM: return "faces" - elif "node" in dim_lower: + elif dim_name == NODE_DIM: return "nodes" - elif "edge" in dim_lower: + elif dim_name == EDGE_DIM: return "edges" return None From 0a8c46fe362fbf34e15c1915c5084ed51a090a18 Mon Sep 17 00:00:00 2001 From: erogluorhan Date: Thu, 13 Aug 2026 09:23:18 -0600 Subject: [PATCH 2/2] Address Sam's comment on dimension names docstrings --- uxarray/remap/spatial_coords_remap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uxarray/remap/spatial_coords_remap.py b/uxarray/remap/spatial_coords_remap.py index c8142480a..c41bc5f04 100644 --- a/uxarray/remap/spatial_coords_remap.py +++ b/uxarray/remap/spatial_coords_remap.py @@ -174,7 +174,7 @@ def _get_element_type_from_dimension(self, dim_name: str) -> Optional[str]: Parameters ---------- dim_name : str - Dimension name (e.g., 'n_face', 'nMesh2_face', etc.) + Dimension name (either "n_face", "n_node", or "n_edge") Returns -------