From 41f8c145351255206a3bcc8d28c33735566dff08 Mon Sep 17 00:00:00 2001 From: Abellegese Date: Fri, 17 Jan 2025 02:36:23 +0300 Subject: [PATCH] fix for error tabular output table --- ersilia/cli/commands/run.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ersilia/cli/commands/run.py b/ersilia/cli/commands/run.py index e14c413d4..54807f5e5 100644 --- a/ersilia/cli/commands/run.py +++ b/ersilia/cli/commands/run.py @@ -1,3 +1,4 @@ +import json import types import click @@ -76,14 +77,17 @@ def run(input, output, batch_size, as_table): if as_table: print_result_table(iter_values) else: - echo("\n".join(map(str, iter_values))) + formatted_values = [json.dumps(item) for item in iter_values] + echo("\n".join(formatted_values)) else: if as_table: print_result_table(result) else: try: - echo(str(result)) + echo(result) except Exception: - print_result_table(result) + echo( + f"Error: Could not print the result for output given path: {result}." + ) return run