Skip to content

Refactor flat_multiscale connectivity to support crop_to_convex_hull #145

Description

@AdMub

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions