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

Function partition_has_duplicate_proc_ids

python/binary_partition_utils.py:39–49  ·  view source on GitHub ↗

Returns True if the partition has more than one node with the same proc_id. Args: partition: the BinaryPartition node Returns: A boolean indicating if the partition contains duplicate proc_ids.

(partition: mp.BinaryPartition)

Source from the content-addressed store, hash-verified

37
38
39def partition_has_duplicate_proc_ids(partition: mp.BinaryPartition) -> bool:
40 """Returns True if the partition has more than one node with the same proc_id.
41
42 Args:
43 partition: the BinaryPartition node
44
45 Returns:
46 A boolean indicating if the partition contains duplicate proc_ids.
47 """
48 proc_ids = [node.proc_id for node in enumerate_leaf_nodes(partition)]
49 return len(set(proc_ids)) != len(proc_ids)
50
51
52def get_total_weight(

Callers 2

get_total_weightFunction · 0.85
get_grid_volumes_in_treeFunction · 0.85

Calls 1

enumerate_leaf_nodesFunction · 0.85

Tested by

no test coverage detected