Skip to content

Commit 70a3219

Browse files
committed
Code cleanup
1 parent 15bb643 commit 70a3219

5 files changed

Lines changed: 16 additions & 15 deletions

File tree

abm/lib/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ def find_dataset(gi, history_id, name_or_id):
456456
# return datasets[0]['id']
457457

458458

459-
460459
def find_config(name: str) -> str:
461460
if os.path.exists(".abm"):
462461
if os.path.exists(f".abm/{name}"):

abm/lib/config.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@
22
from pathlib import Path
33

44
import yaml
5-
from common import (
6-
Context,
7-
find_config,
8-
get_yaml_parser,
9-
load_profiles,
10-
print_json,
11-
print_yaml,
12-
save_config,
13-
save_profiles,
14-
)
5+
from common import (Context, find_config, get_yaml_parser, load_profiles,
6+
print_json, print_yaml, save_config, save_profiles)
157

168

179
def do_list(context: Context, args: list):

abm/lib/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def upload(context: Context, args: list):
133133
result = gi.tools.upload_file(url, history, file_name=name)
134134
print(result)
135135

136+
136137
def collection(context: Context, args: list):
137138
type = 'list:paired'
138139
collection_name = 'collection'

abm/lib/experiment.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ def summarize(context: Context, args: list):
235235
# cpu = '' if len(row[11]) == 0 else f"{float(row[11])/10**9:4.1f}"
236236
memory_cell = 13
237237
# memory_cell = 11
238-
memory = '' if len(row[memory_cell]) == 0 else f"{float(row[memory_cell])/GB:4.3f}"
238+
memory = (
239+
''
240+
if len(row[memory_cell]) == 0
241+
else f"{float(row[memory_cell])/GB:4.3f}"
242+
)
239243
# memory = '' if len(row[memory_cell]) == 0 else f"{float(row[memory_cell])}"
240244
# memory = float(row[13]) / GB
241245
print(
@@ -259,13 +263,14 @@ def summarize(context: Context, args: list):
259263
'galaxy_slots',
260264
'galaxy_memory_mb',
261265
'runtime_seconds',
262-
'cpuacct.usage', # Shouldn't this be cpu.stat.usage_usec?
266+
'cpuacct.usage', # Shouldn't this be cpu.stat.usage_usec?
263267
'memory.limit_in_bytes',
264268
'memory.peak',
265269
] # ,'memory.soft_limit_in_bytes']
266270

267271
accept_metrics = accept_metrics_v2
268272

273+
269274
def make_table_row(data: dict):
270275
row = [
271276
str(data[key])

abm/lib/job.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
def do_list(context: Context, args: list):
1313
parser = argparse.ArgumentParser()
1414
parser.add_argument('-s', '--state', help='list jobs in this state', required=False)
15-
parser.add_argument('--history', help='show jobs in the given history', required=False)
15+
parser.add_argument(
16+
'--history', help='show jobs in the given history', required=False
17+
)
1618
parser.add_argument('-u', '--user', help='show jobs for this user', required=False)
1719
argv = parser.parse_args(args)
1820

@@ -28,7 +30,9 @@ def do_list(context: Context, args: list):
2830
if history_id is None:
2931
print("ERROR: No such history")
3032
return
31-
job_list = gi.jobs.get_jobs(state=argv.state, history_id=argv.history, user_id=argv.user)
33+
job_list = gi.jobs.get_jobs(
34+
state=argv.state, history_id=argv.history, user_id=argv.user
35+
)
3236
log.debug(f"Iterating over job list with {len(job_list)} items")
3337
for job in job_list:
3438
print(f"{job['id']}\t{job['state']}\t{job['update_time']}\t{job['tool_id']}")

0 commit comments

Comments
 (0)