Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -88,7 +88,7 @@ def act_on_files (action,listfiles,listres=None,suffix='.txt',filter='f',sub='\. · 87 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | class bench: |
| 90 | 90 | """ class to run benchmarks on directories """ |
| 91 | − def __init__(self,datadir,resdir=None,checkres=False,checkanno=False): | |
| 91 | + def __init__(self,datadir,resdir=None,checkres=False,checkanno=False,params=[]): | |
| 92 | 92 | self.datadir = datadir |
| 93 | 93 | # path to write results path to |
| 94 | 94 | self.resdir = resdir |
| @@ -96,6 +96,8 @@ class bench: · 1 unmodified line | ||
| 96 | 96 | self.reslist = [] |
| 97 | 97 | # list used to gather results |
| 98 | 98 | self.results = [] |
| 99 | + if not params: self.params = taskparams() | |
| 100 | + else: self.params = params | |
| 99 | 101 | print "Checking data directory", self.datadir |
| 100 | 102 | self.checkdata() |
| 101 | 103 | if checkanno: self.checkanno() |
| @@ -104,10 +106,8 @@ class bench: · 2 unmodified lines | ||
| 104 | 106 | def checkdata(self): |
| 105 | 107 | if os.path.isfile(self.datadir): |
| 106 | 108 | self.dirlist = os.path.dirname(self.datadir) |
| 107 | − print "DBG: found a file" | |
| 108 | 109 | elif os.path.isdir(self.datadir): |
| 109 | 110 | self.dirlist = list_dirs(self.datadir) |
| 110 | − print "DBG: found a dir" | |
| 111 | 111 | # allow dir* matching through find commands? |
| 112 | 112 | else: |
| 113 | 113 | print "ERR: path not understood" |
| @@ -215,3 +215,9 @@ class bench: · 101 unmodified lines | ||
| 215 | 215 | self.dir_exec() |
| 216 | 216 | self.dir_eval() |
| 217 | 217 | self.dir_plot() |
| 218 | + | |
| 219 | + def dir_eval_print(self): | |
| 220 | + self.dir_exec() | |
| 221 | + self.dir_eval() | |
| 222 | + self.pretty_print() | |
| 223 | + | |