_check_flow_general_properties rejects empty graphs with PartialOrderError(PartialOrderErrorReason.Empty), even though the formal definitions of flows do not exclude empty graphs. As a result, flow‑extraction procedures return an empty flow object for an empty graph, but that object then fails the well‑formedness check.
def test_empty_graph() -> None:
og = OpenGraph(graph=nx.Graph(), input_nodes=[], output_nodes=[], measurements={})
pf = og.extract_causal_flow()
pf.check_well_formed() # raises PartialOrderError(PartialOrderErrorReason.Empty)
Edit: I copy-pasted the wrong exception. In this example, pf.check_well_formed() raises graphix.flow.exceptions.PartialOrderLayerError: The first layer of the partial order must contain all the output nodes of the open graph and cannot be empty. First layer: frozenset().
_check_flow_general_propertiesrejects empty graphs withPartialOrderError(PartialOrderErrorReason.Empty), even though the formal definitions of flows do not exclude empty graphs. As a result, flow‑extraction procedures return an empty flow object for an empty graph, but that object then fails the well‑formedness check.Edit: I copy-pasted the wrong exception. In this example,
pf.check_well_formed()raisesgraphix.flow.exceptions.PartialOrderLayerError: The first layer of the partial order must contain all the output nodes of the open graph and cannot be empty. First layer: frozenset().