Skip to content

graph: Misleading reporting of node in cycle for CycleError #165

@matthiasdiener

Description

@matthiasdiener

Initially reported by @majosm.

With this code:

graph={1: {}, 5: {1, 8}, 8: {5}}

from pytools.graph import compute_topological_order
compute_topological_order(graph)

image

compute_topological_order reports:

  File "/Users/mdiener/Work/emirge/pytools/pytools/graph.py", line 303, in compute_topological_order
    raise CycleError(next(iter(n for n, num_preds in
pytools.graph.CycleError: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions