Skip to content

Commit

Permalink
Better column formatting for markdown tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuderman committed Dec 12, 2023
1 parent 7bbafe4 commit bfe272b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abm/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def summarize_metrics(gi, jobs: list):

def print_markdown_table(table: list) -> None:
print('| Tool ID | History | State | CPU (sec) | Memory (GB) | Runtime (sec)|')
print('|---|---|---|---|---|---|')
print('|---|---|---|---:|---:|---:|')
GB = 1024 * 1024 * 1024
for row in table[1:]:
history = row[2]
Expand All @@ -261,7 +261,7 @@ def print_markdown_table(table: list) -> None:
runtime = float(row[15])
# line = ' | '.join( row[i] for i in [0,2,3,4,7,11,15])
# print(f'| {line} |')
print(f'| {tool_id} | {history} | {state} | {cpu:6.1f} | {memory:3.3f} | {runtime:6.1f} |')
print(f'| {tool_id} | {history} | {state} | {cpu:5.1f} | {memory:3.3f} | {runtime:5.1f} |')


def metrics_to_dict(metrics: list, accept: list):
Expand Down

0 comments on commit bfe272b

Please sign in to comment.