inducer / inducer/pytools

graph: Misleading reporting of node in cycle for CycleError

Open
#165 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
73
Forks
26
Avg merge
7h 3m
Merged PRs (30d)
2

Description

Initially reported by @majosm.

With this code:

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

from pytools.graph import compute_topological_order
compute_topological_order(graph)
```

![image](https://user-images.githubusercontent.com/1772435/206310361-f6cd6168-b80f-4ee7-a644-98978444945a.png)

`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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.