Skip to content

IO for fesom not converting n2 to two during open_grid #1717

Description

@dylannelson

Version

2026.7.1

How did you install UXarray?

Source

What happened?

When making a fix for #1444 in PR #1667, we noticed there were far more outliers than expected, in an attempt to clean grid files. One example was this file:

Image

In a bit less detail it looks like this:

Image

We didn't expect this many non-grid dimensions on the grid, and we assume that n2 is likely supposed to be converted to "two" which is a dimension we expect. We would need to resolve this before proceeding, as we don't want to delete it in our planned cleaning process, if it actually needs to be converted to "two"

What did you expect to happen?

To see "two" as a dimension, not "n2"

Can you provide a MCVE to repoduce the bug?

import warnings
from pathlib import Path

warnings.filterwarnings("ignore")
import uxarray as ux

MESHFILES = "../../uxarray/test/meshfiles/"

# FESOM2 mesh.diag — nz, nz1, n2, N, n4
mesh_diag = ux.open_grid(MESHFILES + "ugrid/fesom/fesom.mesh.diag.nc")
mesh_diag

# --- separate cell ---

GRID_DIMS = set(ux.conventions.ugrid.DIM_NAMES)
print("  dims          :", dict(mesh_diag._ds.sizes))
print("  non-grid dims :", [d for d in mesh_diag._ds.sizes if d not in GRID_DIMS])
print("  coords        :", list(mesh_diag._ds.coords))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextra dimsHandling of non-grid dimensions, such as time or altitude

    Type

    Projects

    Status
    📚 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions