diff --git a/uxarray/remap/spatial_coords_remap.py b/uxarray/remap/spatial_coords_remap.py index 05f6f5e8e..c41bc5f04 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 @@ -173,19 +174,18 @@ 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 ------- 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