Skip to content

Commit

Permalink
Merge pull request #266 from galaxyproject/264-round-values
Browse files Browse the repository at this point in the history
Round up runtime and memory
  • Loading branch information
ksuderman authored Dec 15, 2023
2 parents 7b1a3c9 + 4958a7a commit b064013
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions abm/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import subprocess
import sys
from math import ceil

import bioblend.galaxy
import lib
Expand Down Expand Up @@ -270,12 +271,18 @@ def print_markdown_table(table: list) -> None:
print('|---|---|---:|---:|---:|')
GB = 1024 * 1024 * 1024
for row in table[1:]:
# memory = ''
# if row[11] != '':
# memory = float(row[11]) / GB
# if memory < 0.1:
# memory = 0.1
# memory = f"{memory:3.1f}"
history = row[2]
state = row[3]
tool_id = row[4]
# cpu = '' if row[7] == '' else float(row[7]) / 10**9
memory = '' if row[11] == '' else f"{float(row[11]) / GB:3.3f}"
runtime = '' if row[15] == '' else f"{float(row[15]):5.1f}"
memory = '' if row[11] == '' else f"{max(0.1, float(row[11]) / GB):3.1f}"
runtime = '' if row[15] == '' else f"{max(1, float(row[15])):5.0f}"
print(f'| {tool_id} | {history} | {state} | {memory} | {runtime} |')


Expand Down

0 comments on commit b064013

Please sign in to comment.