Skip to content
Snippets Groups Projects
Commit 2a14713e authored by Luc Giffon's avatar Luc Giffon
Browse files

change gather results to take input/output dir as arguments (docopt)

parent 080f5413
No related branches found
No related tags found
No related merge requests found
"""
gather_results: gather OAR results from one dir to one file called gathered_results in the same directory.
The result files should consist of lines and should have "stdout" in their name.
Usage:
gather_results -i IPATH
Options:
-h --help Show this screen.
-i --input-dir=<IPATH> Inut directory wher to find results
"""
from os import listdir
import os
from os.path import isfile, join
import docopt
if __name__ == '__main__':
mypath = "/home/luc/PycharmProjects/deepFriedConvnets/main/results_global5"
arguments = docopt.docopt(__doc__)
mypath = os.path.abspath(arguments["--input-dir"])
onlyfiles = [os.path.join(mypath, f) for f in listdir(mypath) if isfile(join(mypath, f))]
count = 0
results = []
for f_name in onlyfiles:
if "stderr" in f_name:
if ".stdout" not in f_name:
continue
with open(f_name, "r") as f:
str_f = f.read().strip()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment