From 5283e48e4f9407452d4b0ce28d32c08b8eef43d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Grosdidier?= Date: Sun, 19 Sep 2021 09:19:04 +0200 Subject: [PATCH] Make edge order reproducible between calls, see https://github.com/technologicat/pyan/issues/77 --- pyan/writers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyan/writers.py b/pyan/writers.py index 9531cc9..5006807 100644 --- a/pyan/writers.py +++ b/pyan/writers.py @@ -58,7 +58,7 @@ def write_subgraph(self, graph): def write_edges(self): self.start_edges() - for edge in self.graph.edges: + for edge in sorted(self.graph.edges, key=lambda x: (x.source.id, x.target.id)): self.write_edge(edge) self.finish_edges()