mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
fix: don't draw large graphs in artifacts
This commit is contained in:
@@ -103,14 +103,16 @@ class DebugArtifacts:
|
||||
textual_representation = graph.format()
|
||||
self.textual_representations_of_graphs[name].append(textual_representation)
|
||||
|
||||
try:
|
||||
drawing = graph.draw()
|
||||
self.drawings_of_graphs[name].append(str(drawing))
|
||||
except ImportError as error: # pragma: no cover
|
||||
if "pygraphviz" in str(error):
|
||||
pass
|
||||
else:
|
||||
raise error
|
||||
# 100 is an arbitrary number after which the drawing would become too hard to follow
|
||||
if len(graph.graph.nodes()) < 100:
|
||||
try:
|
||||
drawing = graph.draw()
|
||||
self.drawings_of_graphs[name].append(str(drawing))
|
||||
except ImportError as error: # pragma: no cover
|
||||
if "pygraphviz" in str(error):
|
||||
pass
|
||||
else:
|
||||
raise error
|
||||
|
||||
self.final_graph = graph
|
||||
|
||||
|
||||
Reference in New Issue
Block a user