grapher.to_series_graph()
Collapse a cell graph to one node per bound series with consolidated edges.
Usage
grapher.to_series_graph(
graph,
occupancy,
*,
include_self_loops=False,
)Series that own graph nodes are included even when they have no cross-series edges. Unbound cells and dangling endpoints that do not resolve to a graph node are skipped, matching to_sheet_graph.
Parameters
graph: DependencyGraph | GraphReadView-
Cell-level dependency graph or read view.
occupancy: SeriesGraphOccupancy-
Cell-to-series mapping. A SeriesCatalog satisfies CatalogOccupancy (
SeriesGraphOccupancy). include_self_loops: bool = False-
If
True, keep intra-series cell edges as a single self-loop per series. IfFalse(default), drop them.
Returns
SeriesGraph-
Immutable series graph. Node order follows
occupancy.orderwhenpresent; otherwise ids sort lexicographically. Edges follow the same
order on(source, target).