Skip to content

Commit

Permalink
Merge pull request #27 from sbrugman/patch-1
Browse files Browse the repository at this point in the history
feat: explainer support pdf
  • Loading branch information
parrt authored Sep 20, 2021
2 parents b0e45ee + 715d234 commit 6b29954
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tsensor/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import traceback
import inspect
import hashlib
from pathlib import Path

import matplotlib.pyplot as plt

Expand Down Expand Up @@ -339,9 +340,10 @@ def viz_statement(self, code, frame):
hush_errors=self.explainer.hush_errors)
self.views.append(view)
if self.explainer.savefig is not None:
svgfilename = f"{self.explainer.savefig}-{self.linecount}.svg"
view.savefig(svgfilename)
view.filename = svgfilename
file_path = Path(self.explainer.savefig)
file_path = f"{file_path.stem}-{self.linecount}{file_path.suffix}"
view.savefig(file_path)
view.filename = file_path
plt.close()
else:
view.show()
Expand Down

0 comments on commit 6b29954

Please sign in to comment.