Skip to content

Commit

Permalink
Minor changes for result ouput
Browse files Browse the repository at this point in the history
  • Loading branch information
John Hawkins authored and John Hawkins committed Sep 15, 2021
1 parent b383da6 commit fc161e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion projit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.7"
__version__ = "0.1.8"

from .utils import locate_projit_config
from .projit import projit_load
Expand Down
3 changes: 2 additions & 1 deletion projit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion projit/projit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit fc161e2

Please sign in to comment.