Skip to content

Commit

Permalink
adding (mostly empty) results for python
Browse files Browse the repository at this point in the history
the binary was not detected in the install so we do not have actual runs

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Nov 17, 2021
1 parent c75d5ce commit 0e20176
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions visualize-predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ def main(pkg_dir):
if commands and datum["command"] not in commands:
print("Warning: multiple commands being used for testing!")
commands.add(datum["command"])

dfs["actual"].loc[binary][lib] = 1 if datum["actual"] else -1
for tester, res in datum["predictions"].items():
for binary, predictions in res.items():
dfs["actual"].loc[binary][lib] = 1 if datum["actual"] else -1
for lib, prediction in predictions.items():
prediction = 1 if prediction else -1
dfs[tester].loc[binary][lib] = prediction
Expand All @@ -125,7 +124,11 @@ def main(pkg_dir):

# Save the data frame to file
count = 0
splice = None
for tester, df in dfs.items():
if df.shape[0] == 0:
print("Warning, df for %s is empty." % tester)
continue

# Update listing
if count == 0:
Expand Down Expand Up @@ -156,17 +159,18 @@ def main(pkg_dir):
count += 1

# Generate a markdown for each
content = template % (
package,
package,
listing,
splice,
package,
"\n".join(list(commands)),
)
md = os.path.join(result_dir, "index.md")
with open(md, "w") as fd:
fd.write(content)
if splice:
content = template % (
package,
package,
listing,
splice,
package,
"\n".join(list(commands)),
)
md = os.path.join(result_dir, "index.md")
with open(md, "w") as fd:
fd.write(content)


if __name__ == "__main__":
Expand Down

0 comments on commit 0e20176

Please sign in to comment.