Description
Following the implementation of spatial mesh pruning via Delaunay triangulation in PR #58, the crop_to_convex_hull feature currently supports keisler (flat) and hierarchical architectures.
However, it currently raises a ValueError if used with flat_multiscale (GraphCast) graphs.
The Bottleneck
The limitation exists because create_flat_multiscale_from_coordinates (in mesh/connectivity/flat.py) merges hierarchy levels by reshaping the node array under the assumption of a full (nx, ny, 2) rectangular grid and striding over indices. Once nodes are pruned spatially, this array reshaping fails.
Proposed Solution
To fully support multiscale graphs, the merging logic needs to be refactored to be position-based (spatial) rather than index-based. This will allow the graph to correctly connect coarser levels to the finest levels even when the grid is irregular or spatially cropped.
Note: This issue was spun off from PR #58 to prevent scope creep on the v0.4.0 release.
Description
Following the implementation of spatial mesh pruning via Delaunay triangulation in PR #58, the
crop_to_convex_hullfeature currently supportskeisler(flat) andhierarchicalarchitectures.However, it currently raises a
ValueErrorif used withflat_multiscale(GraphCast) graphs.The Bottleneck
The limitation exists because
create_flat_multiscale_from_coordinates(inmesh/connectivity/flat.py) merges hierarchy levels by reshaping the node array under the assumption of a full(nx, ny, 2)rectangular grid and striding over indices. Once nodes are pruned spatially, this array reshaping fails.Proposed Solution
To fully support multiscale graphs, the merging logic needs to be refactored to be position-based (spatial) rather than index-based. This will allow the graph to correctly connect coarser levels to the finest levels even when the grid is irregular or spatially cropped.
Note: This issue was spun off from PR #58 to prevent scope creep on the
v0.4.0release.