Skip to content

Commit

Permalink
simplify table
Browse files Browse the repository at this point in the history
  • Loading branch information
mdingemanse authored Apr 19, 2024
1 parent b77e44c commit 118450a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions scripts/consolidate_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def write_simplified_html(df):
# first row
source_link = "https://github.com/opening-up-chatgpt/opening-up-chatgpt.github.io/blob/main" + df.loc[p, "source.file"]
source_file = source_link.split("/")[-1]
#r1_html = '<tr class="row-a"><td class="name-cell"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(df.loc[p, "project.link"], df.loc[p, "project.notes"], p)
r1_html = '<tr class="row-a"><td class="name-cell"><a target="_blank" href="{}" title="data: {}">{}</a></td>'.format(source_link, source_file, p)
for c in cells:
cl = df.loc[p, c + ".class"]
Expand All @@ -123,19 +122,11 @@ def write_simplified_html(df):
r1_html += '<td class="{} data-cell"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(cl, link, notes, symbol)
r1_html += "</tr>\n"
html_table += r1_html
# second row
#r2_html = '<tr class="row-b"><td class="org"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(df.loc[p, "org.link"], df.loc[p, "org.name"], df.loc[p, "org.name"])
r2_html = '<tr class="row-b"><td class="org"><a target="_blank" href="{}" title="{}">{}</a></td>'.format(df.loc[p, "project.link"], df.loc[p, "project.notes"], df.loc[p, "org.name"])
r2_html += '<td colspan="3" class="llmbase">LLM base: {}</td><td colspan="3" class="rlbase">RL base: {}</td>'.format(df.loc[p, "project.llmbase"], df.loc[p, "project.rlbase"])
#r2_html += '<td colspan="7"></td><td class="source-link"><a href="{}" title="{}" target="_blank">&sect;</a></td></tr>\n'.format(source_link, source_file)
r2_html += '<td colspan="7"></td><td class="source-link"><a href="{}" title="{}" target="_blank">&sect;</a></td></tr>\n'.format(df.loc[p, "org.link"], df.loc[p, "org.name"])
html_table += r2_html
# closing tags
html_table += '</tbody>\n'
html_table += '</table>\n'
return html_table


def create_index(table):
# read and parse the template file
with open("./docs/template.html", "r") as f:
Expand All @@ -156,7 +147,7 @@ def create_index(table):

def create_figure(figure):
# read and parse the template file
with open("./docs/template.html", "r") as f:
with open("./docs/template_figure.html", "r") as f:
html = f.read()
soup = BeautifulSoup(html, "html.parser")
# find the target location
Expand Down

0 comments on commit 118450a

Please sign in to comment.