From fc161e2fb40a67f1ed59656967ead1603d417c0f Mon Sep 17 00:00:00 2001 From: John Hawkins Date: Wed, 15 Sep 2021 12:00:12 +1000 Subject: [PATCH] Minor changes for result ouput --- projit/__init__.py | 2 +- projit/cli.py | 3 ++- projit/projit.py | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/projit/__init__.py b/projit/__init__.py index 4ffed67..feb62f5 100644 --- a/projit/__init__.py +++ b/projit/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1.7" +__version__ = "0.1.8" from .utils import locate_projit_config from .projit import projit_load diff --git a/projit/cli.py b/projit/cli.py index 1ccff92..e0c398f 100644 --- a/projit/cli.py +++ b/projit/cli.py @@ -146,12 +146,13 @@ def list(subcmd, project, argv): print(" ", exp[0], filler(len(exp[0]), long_key+1 ), exp[1] ) print("") elif subcmd == "results": + dataset = "*" if len(argv)>3: dataset = argv[3] rez = project.get_results(dataset) else: rez = project.get_results() - print(" ___Results_____________________________________") + print(" ___Results__________________________________[ %s ]___" % dataset) pd.set_option('expand_frame_repr', False) pd.set_option('display.max_columns', 999) print(rez) diff --git a/projit/projit.py b/projit/projit.py index 1c38b53..5721d17 100644 --- a/projit/projit.py +++ b/projit/projit.py @@ -238,7 +238,13 @@ def get_results(self, dataset=None): rez = {} rez['experiment'] = key df = df.append(rez, ignore_index=True) - return df + + # Ensure that the first column in the results is "experiments" + cols = ["experiment"] + rest = df.columns.to_list() + rest.remove('experiment') + cols.extend(rest) + return df.loc[:,cols] def get_dataset(self, name): """