Skip to content

Scrip edge and node order changes each time the grid is loaded #1738

Description

@Sevans711

Version

v2026.08.01

How did you install UXarray?

Source

What happened?

Loading a grid from a SCRIP source leads to a different order for nodes and edges each time the grid is loaded.

I noticed this while exploring MESACLIP data on casper, but I can also see that the bug occurs in the SCRIP example in uxarray.tutorial.

What did you expect to happen?

I expected the node and edge order to be based solely on the file, and be the same each time it is loaded, not to change in a seemingly-random way when the file is loaded multiple times.

Can you provide a MCVE to repoduce the bug?

gridA = ux.tutorial.open_grid('scrip-ne30pg2')
gridB = ux.tutorial.open_grid('scrip-ne30pg2')
gridA == gridB   # expected True, got False.
# Same bug if using 'scrip-outCSne8' instead.

# Also can see it by repeatedly running the following two lines in a jupyter cell:
arr = ux.tutorial.open_grid('scrip-ne30pg2')['RELHUM']
arr.isel(lev=0, n_node=slice(None, 100)).plot()
# The plot will change each time, because the node order has changed.
# Similar issue if using n_edge=slice(None, 100).

# If using n_face=slice(None, 100), the plot does not change
# (faces' locations and data remain correct).

# If not slicing at all, the plot does not change,
# because arr.plot() is not sensitive to node/edge order.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions