Peano
Loading...
Searching...
No Matches
test_splittrees_leaf_distribution Namespace Reference

Functions

 _balanced_decomposition (total_leaves, number_of_subtrees)
 Build an even decomposition list expected by Stage I helpers.
 
 test_leaf_distribution_balanced_across_subtrees (dimensions, number_of_subtrees)
 Stage I ("Leaf Distribution") invariant test in 2D and 3D.
 
 test_leaf_distribution_does_not_modify_non_leaf_nodes (dimensions)
 Stage I invariant: non-leaf nodes (internal nodes with children) must NOT be modified by Stage I leaf distribution.
 
 test_leaf_distribution_only_redistributes_subtree_0 (dimensions)
 Stage I invariant: only leaves in subtree 0 are redistributed.
 
 test_leaf_distribution_preserves_node_existence_weights (dimensions)
 Stage I invariant: node existence flags (weights) must NOT be modified.
 
 test_leaf_distribution_returns_correct_moved_nodes_count (dimensions)
 Stage I invariant: the returned moved_nodes list must accurately reflect how many leaves were assigned to each subtree.
 

Function Documentation

◆ _balanced_decomposition()

test_splittrees_leaf_distribution._balanced_decomposition (   total_leaves,
  number_of_subtrees 
)
protected

◆ test_leaf_distribution_balanced_across_subtrees()

test_splittrees_leaf_distribution.test_leaf_distribution_balanced_across_subtrees (   dimensions,
  number_of_subtrees 
)

Stage I ("Leaf Distribution") invariant test in 2D and 3D.

Verify that leaves from subtree 0 are distributed as evenly as possible across number_of_subtrees subtrees.

Definition at line 27 of file test_splittrees_leaf_distribution.py.

References _balanced_decomposition().

Here is the call graph for this function:

◆ test_leaf_distribution_does_not_modify_non_leaf_nodes()

test_splittrees_leaf_distribution.test_leaf_distribution_does_not_modify_non_leaf_nodes (   dimensions)

Stage I invariant: non-leaf nodes (internal nodes with children) must NOT be modified by Stage I leaf distribution.

Definition at line 70 of file test_splittrees_leaf_distribution.py.

References _balanced_decomposition().

Here is the call graph for this function:

◆ test_leaf_distribution_only_redistributes_subtree_0()

test_splittrees_leaf_distribution.test_leaf_distribution_only_redistributes_subtree_0 (   dimensions)

Stage I invariant: only leaves in subtree 0 are redistributed.

Leaves already in other subtrees must NOT be modified.

Definition at line 133 of file test_splittrees_leaf_distribution.py.

References _balanced_decomposition().

Here is the call graph for this function:

◆ test_leaf_distribution_preserves_node_existence_weights()

test_splittrees_leaf_distribution.test_leaf_distribution_preserves_node_existence_weights (   dimensions)

Stage I invariant: node existence flags (weights) must NOT be modified.

Stage I only changes subtree assignments, not node existence.

Definition at line 186 of file test_splittrees_leaf_distribution.py.

References _balanced_decomposition().

Here is the call graph for this function:

◆ test_leaf_distribution_returns_correct_moved_nodes_count()

test_splittrees_leaf_distribution.test_leaf_distribution_returns_correct_moved_nodes_count (   dimensions)

Stage I invariant: the returned moved_nodes list must accurately reflect how many leaves were assigned to each subtree.

Definition at line 235 of file test_splittrees_leaf_distribution.py.

References _balanced_decomposition().

Here is the call graph for this function: