MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _UF

Class _UF

SLiCAP/schematic/connectivity.py:28–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28class _UF:
29 def __init__(self):
30 self._p: dict[tuple, tuple] = {}
31
32 def _ensure(self, x):
33 if x not in self._p:
34 self._p[x] = x
35
36 def find(self, x) -> tuple:
37 self._ensure(x)
38 if self._p[x] != x:
39 self._p[x] = self.find(self._p[x])
40 return self._p[x]
41
42 def union(self, a, b):
43 ra, rb = self.find(a), self.find(b)
44 if ra != rb:
45 self._p[rb] = ra
46
47
48def resolve_nets(

Callers 3

resolve_netsFunction · 0.85
_sync_port_net_namesMethod · 0.85
_wires_on_same_netMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected