You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UxDataArray.subset.bounding_box() on edge-centered data crashes with confusing KeyError: No variable named '_subgrid_edge_indices'... if connectivity isn't populated #1888
Calling UxDataArray.subset.bounding_box(...) on edge-centered data crashes with a very confusing error (see title), if face_edge_connectivity has not yet been populated.
Similar to #1758 but scoped to subsetting operations instead of isel and sel operations. Initially mentioned by @cmdupuis3 in #1875 (review).
I didn't test the other subset operations yet but since they also use _slice_from_grid I would expect similar behavior. While the title and description above are scoped only to bounding_box, the scope of this issue should actually be considered to be all subset operations; a full fix here should fix it for the other subset operations like bounding_circle and constant_latitude, too.
What did you expect to happen?
I expected a clearer error message, or for face_edge_connectivity to be populated automatically so that this operation can complete successfully.
Can you provide a MCVE to repoduce the bug?
importuxarrayasuxarr=ux.tutorial.open_dataset('quad-hexagon-random-edge')['random_data_edge']
arr.subset.bounding_box((-50, 50), (-50, 50)) # crashes# but, if running the following before calling bounding_box():arr.uxgrid.face_edge_connectivity# then the bounding_box() command does not crash:arr.subset.bounding_box((-50, 50), (-50, 50))
Activity