Skip to content

Improve test_create_decode_mask #103

@zweihuehner

Description

@zweihuehner

I feel like the test test_create_decode_mask should be more specific. Currently, it verifies that the total number of edges decreases when applying a decode mask. However, checking the m2g (decoding) edges alone should be sufficient.

I don't think the test can fail in the current version. However, I encountered issues on the research branch where the decode_mask also affects the g2m behavior, which can increase the total number of edges in the graph. This made me realize that it would be more future-proof to make the test more specific.

unfiltered_graph = fn(coords=xy, mesh_node_distance=mesh_node_distance)
# Filter to only 20 / 100 grid nodes
decode_mask = np.concatenate((np.ones(20), np.zeros(80))).astype(bool)
filtered_graph = fn(
coords=xy, mesh_node_distance=mesh_node_distance, decode_mask=decode_mask
)
# Check that some filtering has been performed
assert len(filtered_graph.edges) < len(unfiltered_graph.edges)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions