Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions uxarray/remap/spatial_coords_remap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down