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 @@ -1384,6 +1384,7 @@ def saturate(
1384
1384
* ,
1385
1385
expr : Expr | None = None ,
1386
1386
max : int = 1000 ,
1387
+ visualize : bool = True ,
1387
1388
** kwargs : Unpack [GraphvizKwargs ],
1388
1389
) -> None :
1389
1390
"""
@@ -1399,18 +1400,22 @@ def to_json() -> str:
1399
1400
print (self .extract (expr ), "\n " )
1400
1401
return self ._serialize (** kwargs ).to_json ()
1401
1402
1402
- egraphs = [to_json ()]
1403
+ if visualize :
1404
+ egraphs = [to_json ()]
1403
1405
i = 0
1404
1406
# Always visualize, even if we encounter an error
1405
1407
try :
1406
1408
while (self .run (schedule or 1 ).updated ) and i < max :
1407
1409
i += 1
1408
- egraphs .append (to_json ())
1410
+ if visualize :
1411
+ egraphs .append (to_json ())
1409
1412
except :
1410
- egraphs .append (to_json ())
1413
+ if visualize :
1414
+ egraphs .append (to_json ())
1411
1415
raise
1412
1416
finally :
1413
- VisualizerWidget (egraphs = egraphs ).display_or_open ()
1417
+ if visualize :
1418
+ VisualizerWidget (egraphs = egraphs ).display_or_open ()
1414
1419
1415
1420
@classmethod
1416
1421
def current (cls ) -> EGraph :
You can’t perform that action at this time.
0 commit comments