Skip to content

Commit

Permalink
Experiment with table gen
Browse files Browse the repository at this point in the history
  • Loading branch information
fivegrant committed Aug 30, 2023
1 parent 16fb7ee commit 60a8aed
Show file tree
Hide file tree
Showing 3 changed files with 667 additions and 11 deletions.
37 changes: 37 additions & 0 deletions create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## LLM GENERATED

This comment has been minimized.

Copy link
@orm011

orm011 Aug 31, 2023

Love it!

This comment has been minimized.

Copy link
@fivegrant

fivegrant Sep 1, 2023

Author Collaborator

ended up throwing out the LLM generated stuff and started using streamlit. LLMs weren't cutting it but we thought this would have a been a fun usecase to try them on!

import json

data_dict = json.load(open("tests/output/report.json"))

html = '<table border="1">\n'

html += '<tr>\n<th>Tests/Operations</th>\n'
unique_operations = set()

for scenario, values in data_dict.items():
for operation in values["operations"]:
unique_operations.add(operation)

for operation in sorted(unique_operations):
html += f'<th>{operation}</th>\n'
html += '</tr>\n'

unique_tests = set()
for scenario, values in data_dict.items():
for operation, tests in values["operations"].items():
for test in tests:
unique_tests.add(test)

for test in sorted(unique_tests):
html += f'<tr>\n<td>{test}</td>\n'
for operation in sorted(unique_operations):
html += '<td>'
for scenario, values in data_dict.items():
if operation in values["operations"] and test in values["operations"][operation]:
html += f"{values['name']} ({'✅' if values['operations'][operation][test] else '❌'})<br>"
html += '</td>\n'
html += '</tr>\n'

html += '</table>\n'

print(html)
Loading

0 comments on commit 60a8aed

Please sign in to comment.