105 net: Network, flows: Mapping[str, float], boundary: frozenset[str]
106) -> tuple[float, float]:
107 """``(in, out)`` [kg/s] across the boundary, from one solve's flows.
109 A branch between two boundary nodes carries nothing the stand holds, and a
110 branch with neither end on the boundary is internal; only a branch with
111 exactly one end there crosses it.
114 for branch_id, branch
in net.branches.items():
115 flow = flows.get(branch_id, 0.0)
118 up, down = branch.upstream
in boundary, branch.downstream
in boundary
122 signed = flow
if down
else -flow