Skip to content

Commit

Permalink
🐛 Fix pytypes non-deterministic generation
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Oct 14, 2024
1 parent 83ec13e commit 8666038
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wake/development/pytypes_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ def generate_source_unit(source_unit: SourceUnit) -> None:
for node, in_degree in graph.in_degree() # pyright: ignore reportGeneralTypeIssues
if in_degree == 0
]
heapq.heapify(sources)
heapq.heapify(sorted(sources))
visited: Set[str] = set(sources)

while len(sources) > 0:
Expand Down Expand Up @@ -1767,6 +1767,7 @@ def generate_source_unit(source_unit: SourceUnit) -> None:

generated_cycles: Set[FrozenSet[str]] = set()
simple_cycles = [set(c) for c in nx.simple_cycles(graph)]
simple_cycles.sort(key=lambda cycle: sorted(cycle))
if len(simple_cycles) > 0:
# used for reporting to user
cycles_detected = True
Expand Down

0 comments on commit 8666038

Please sign in to comment.