MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _side_counts

Function _side_counts

SLiCAP/schematic/subcircuit.py:98–102  ·  view source on GitHub ↗

Split ``n`` ports across the four sides (top, right, bottom, left) as evenly as possible, with any remainder filling sides in clockwise order.

(n: int)

Source from the content-addressed store, hash-verified

96
97
98def _side_counts(n: int) -> list[int]:
99 """Split ``n`` ports across the four sides (top, right, bottom, left) as
100 evenly as possible, with any remainder filling sides in clockwise order."""
101 base, rem = divmod(n, 4)
102 return [base + (1 if i < rem else 0) for i in range(4)]
103
104
105def _min_half(placement: list) -> tuple[float, float]:

Callers 2

_min_halfFunction · 0.85
box_symbol_svgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected