MCPcopy Create free account
hub / github.com/NanoComp/meep / is_leaf_node

Function is_leaf_node

python/binary_partition_utils.py:9–18  ·  view source on GitHub ↗

Returns True if the partition has no children. Args: partition: the BinaryPartition node Returns: A boolean indicating whether partition is a leaf node.

(partition: mp.BinaryPartition)

Source from the content-addressed store, hash-verified

7
8
9def is_leaf_node(partition: mp.BinaryPartition) -> bool:
10 """Returns True if the partition has no children.
11
12 Args:
13 partition: the BinaryPartition node
14
15 Returns:
16 A boolean indicating whether partition is a leaf node.
17 """
18 return partition.left is None and partition.right is None
19
20
21def enumerate_leaf_nodes(

Callers 2

enumerate_leaf_nodesFunction · 0.85
partitions_are_equalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected