File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1188,6 +1188,7 @@ def saturate(
11881188 * ,
11891189 expr : Expr | None = None ,
11901190 max : int = 1000 ,
1191+ visualize : bool = True ,
11911192 ** kwargs : Unpack [GraphvizKwargs ],
11921193 ) -> None :
11931194 """
@@ -1203,18 +1204,22 @@ def to_json() -> str:
12031204 print (self .extract (expr ), "\n " )
12041205 return self ._serialize (** kwargs ).to_json ()
12051206
1206- egraphs = [to_json ()]
1207+ if visualize :
1208+ egraphs = [to_json ()]
12071209 i = 0
12081210 # Always visualize, even if we encounter an error
12091211 try :
12101212 while (self .run (schedule or 1 ).updated ) and i < max :
12111213 i += 1
1212- egraphs .append (to_json ())
1214+ if visualize :
1215+ egraphs .append (to_json ())
12131216 except :
1214- egraphs .append (to_json ())
1217+ if visualize :
1218+ egraphs .append (to_json ())
12151219 raise
12161220 finally :
1217- VisualizerWidget (egraphs = egraphs ).display_or_open ()
1221+ if visualize :
1222+ VisualizerWidget (egraphs = egraphs ).display_or_open ()
12181223
12191224 @classmethod
12201225 def current (cls ) -> EGraph :
You can’t perform that action at this time.
0 commit comments