Repository navigation
Improve DIM_NAMES and related docs - #1918
Conversation
and add Node Node connectivity to representation.rst, too.
There was a problem hiding this comment.
🟡 Changes recommended
The change still has an active moderate issue because node-node connectivity is not registered in the convention tables or covered by an I/O regression test, and its model-supplied accessor path also lacks coverage.
2 open issues
What changed in this PR
This PR updates UXarray’s recognized dimension names and related documentation to support node-node connectivity and consistently represent cached bounds dimensions.
Changes:
- Removes obsolete edge connectivity dimensions and adds
n_max_node_nodes,lat_lon, andmin_maxtoDIM_NAMES. - Adds the
Grid.n_max_node_nodesproperty and simplifies grid-data filtering. - Updates connectivity and API documentation and adds regression coverage for bounds dimensions in grid representations.
| File | Description |
|---|---|
| uxarray/grid/utils.py | Uses the centralized DIM_NAMES collection when retaining grid variables and filtering non-grid data. |
| uxarray/grid/grid.py | Uses canonical dimension names and adds the Grid.n_max_node_nodes property. |
| uxarray/conventions/ugrid.py | Updates recognized dimension names and documents node-node connectivity dimensions. |
| test/core/test_repr.py | Tests visibility of lat_lon and min_max in grid dimensions and representations. |
| docs/user-guide/representation.rst | Adds node-node connectivity to the connectivity reference table. |
| docs/api.rst | Documents Grid.n_max_node_nodes in the API reference. |
Review effort: Lite
dylannelson
left a comment
There was a problem hiding this comment.
assuming we are leaving all edge_edge_connectivity and node_node_connectivity for another PR, everything looks great. This covered a lot of confusing inconsistencies that were spread out across a few sources. Also really appreciate the updates to the grid cleaning function so that these changes don't break anything. Overall covers everything I could think of that we saw, and a few more things. Built locally and tested the grid cleaning on a handful of files and all turned out as expected. Thanks!
There was a problem hiding this comment.
All the additions here seem like expansion from the #1766's scope, please document accordingly (either revise #1766 and description of this PR, or create/link to a new issue that describes that scope).
Also, regarding the addition of n_max_node_nodes, I think it should technically be equal to n_max_node_edges, but we decided in a team discussion to have explicitly defined dimensions for each separate connectivity, right?
|
@erogluorhan Thank you for your comments and for taking a look at this one. I believe I've addressed them all but please let me know if I missed anything!
When considering the issue title, content, and context in the linked comment/thread, I think a fair interpretation of the scope is something like: "handle anything which is clearly missing from I believe that most of the additions here fall within this clarified scope. However I do think the "Added I don't think there's a need to create a new issue report for the expansions of scope at this point (to me they all still feel like "natural additions" / "on theme" for this PR). I'd be happy to open it though if you want, just let me know!
I agree with your reading; I would always expect these two to be equal, but the discussion pointed towards having explicit dimensions for each separate connectivity. (Though, the same discussion contradicted using "two" as a connectivity dimension. But, "two" was actually already being used elsewhere in the codebase.) Additionally, "n_max_node_nodes" already appears in the docstring of |
|
@Sevans711 I think all is clarified about the PR; thank you! |


Closes #1766
Overview
This PR improves
ugrid.DIM_NAMESand related docs, bringing them up to date with the rest of the codebase. I interpret the implied/intended scope of #1766 to be something broad; roughly: "handle anything which is clearly missing fromugrid.DIM_NAMESor anything which does not belong there, and also update the Connectivity table in the docs accordingly".A few points in this PR go beyond that scope and are labeled accordingly, but the other points here all fall within that scope. In particular:
DIM_NAMES(that is the only place it appeared throughout the entire uxarray codebase, including the docs pages).DIM_NAMES(that is the only place it appeared throughout the entire uxarray codebase, including the docs pages).DIM_NAMES; it is one of the dimensions mentioned in the docstring of the public-facingGrid.node_node_connectivity.ugrid.pywith node_node_connectivity info, analogously toedge_edge_connectivity. UXarray does not yet support constructing either of these directly, but it does support model-supplied values in both cases._drop_non_grid_data.Grid.n_max_node_nodesproperty.Additional expansions of scope:
DIM_NAMES.DIM_NAMES. This is ultimately a design decision, but I believe it makes more sense to include them here instead of special-casing them separately.test_grid_repr_bounds_dimswhich ensures these dims exist ingrid.dimsand are visible inrepr(grid)whenever they exist in the underlying grid object._drop_non_grid_data.PR Checklist
General
Testing & Benchmarking
Documentation and Examples
docs/api.rst; internal (private) function names start with an underscore (_)AI Disclosure
AI Usage: Claude Opus 5.5 to help with surveying and as a sanity check for some decisions, but not for implementing changes directly. Some GitHub Copilot inline code suggestions.