Skip to content

Commit 7c6db21

Browse files
committed
refactor
1 parent 2907471 commit 7c6db21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bench.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ def gen_basic_dict(library, algorithm, stage, params, data, alg_instance=None,
515515
def print_output(library, algorithm, stages, params, functions,
516516
times, metric_type, metrics, data, alg_instance=None,
517517
alg_params=None):
518-
if params.output_format != 'json': return
518+
if params.output_format != 'json':
519+
return
519520
output = []
520521
for i, stage in enumerate(stages):
521522
result = gen_basic_dict(library, algorithm, stage, params,
@@ -538,8 +539,8 @@ def print_output(library, algorithm, stages, params, functions,
538539
result.update({'n_clusters': params.n_clusters})
539540
# replace non-string init with string for kmeans benchmarks
540541
if alg_instance is not None:
541-
if 'init' in result['algorithm_parameters'].keys() and \
542-
not isinstance(result['algorithm_parameters']['init'], str):
542+
if 'init' in result['algorithm_parameters'].keys():
543+
if isinstance(result['algorithm_parameters']['init'], str):
543544
result['algorithm_parameters']['init'] = 'random'
544545
if 'handle' in result['algorithm_parameters'].keys():
545546
del result['algorithm_parameters']['handle']

0 commit comments

Comments
 (0)