Skip to content

Commit

Permalink
test: update plots to include pass/fail
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDavies19 committed Jul 9, 2024
1 parent 12eb664 commit a79b983
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mdf_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: upload test artifacts
name: MD-F comparison plots
path: |
${{github.workspace}}/*.png
9 changes: 7 additions & 2 deletions tests/.mdf_verification/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def to_num(s):
return np.transpose(data), heads


def plot(ref, ref_heads, data, data_heads, fpath):
def plot(ref, ref_heads, data, data_heads, passed, fpath):
if plt is None:
return
fig,axes = plt.subplots(ref.shape[0]-1, 1, sharex = True, figsize=(12.8,4*(ref.shape[0]-1)))
Expand All @@ -292,6 +292,10 @@ def plot(ref, ref_heads, data, data_heads, fpath):
ax[i-1].plot(ref[0, :], ref[i, :], linestyle='dashed',
color='r', label=f"MD-F: {(ref_heads[i])}")
ax[i-1].legend(loc='best')
if passed and (i == 1):
ax[i-1].set_title("PASSED")
elif (not passed) and (i==1):
ax[i-1].set_title("FAILED")

fig.tight_layout()
fig.savefig(fpath, dpi=400)
Expand Down Expand Up @@ -337,10 +341,11 @@ def plot(ref, ref_heads, data, data_heads, fpath):
n_samples = min(ref.shape[1], new.shape[1])
ref = ref[:, :n_samples]
new = new[:, :n_samples]
plot(ref, ref_heads, new, new_heads, test + ".png")
passing = np.all(
pass_fail.passing_channels(ref, new, args.rtol, args.atol))

plot(ref, ref_heads, new, new_heads, passing, test + ".png")

summary[test] = passing

print("")
Expand Down

0 comments on commit a79b983

Please sign in to comment.