Skip to content

Commit 4cc9852

Browse files
committed
model: save trend model plots in baseline directory
Signed-off-by: U. Artie Eoff <[email protected]>
1 parent f28ba9e commit 4cc9852

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/baseline.py

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def __init__(self, filename, rebase = False):
3434
if os.path.isdir(self.filename): # expanded reference files
3535
for root, dirs, files in os.walk(self.filename):
3636
for name in files:
37+
# ignore trendline model plots
38+
if name.endswith(".svg"): continue
3739
with open(os.path.join(root, name), "r") as fd:
3840
self.references.update(json.load(fd))
3941
else: # flat reference file for backwards compatibility

model/encode/util.py

+6
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ def fit(self):
128128
plt.ylim([15, 100])
129129
plt.legend()
130130
plt.savefig(get_media().artifacts.reserve("svg"))
131+
132+
if get_media().baseline.rebase:
133+
svgdir = os.path.join(get_media().baseline.filename, "model", "encode", f"{codec}")
134+
makepath(svgdir)
135+
plt.savefig(os.path.join(svgdir, f"{self.case}.svg"))
136+
131137
# plt.show()
132138
plt.clf()
133139

0 commit comments

Comments
 (0)