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 | class bench: | 89 | class bench: |
| 90 | """ class to run benchmarks on directories """ | 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 | self.datadir = datadir | 92 | self.datadir = datadir |
| 93 | # path to write results path to | 93 | # path to write results path to |
| 94 | self.resdir = resdir | 94 | self.resdir = resdir |
| @@ -96,6 +96,8 @@ class bench: · 1 unmodified line | |||
| 96 | self.reslist = [] | 96 | self.reslist = [] |
| 97 | # list used to gather results | 97 | # list used to gather results |
| 98 | self.results = [] | 98 | self.results = [] |
| 99 | if not params: self.params = taskparams() | ||
| 100 | else: self.params = params | ||
| 99 | print "Checking data directory", self.datadir | 101 | print "Checking data directory", self.datadir |
| 100 | self.checkdata() | 102 | self.checkdata() |
| 101 | if checkanno: self.checkanno() | 103 | if checkanno: self.checkanno() |
| @@ -104,10 +106,8 @@ class bench: · 2 unmodified lines | |||
| 104 | def checkdata(self): | 106 | def checkdata(self): |
| 105 | if os.path.isfile(self.datadir): | 107 | if os.path.isfile(self.datadir): |
| 106 | self.dirlist = os.path.dirname(self.datadir) | 108 | self.dirlist = os.path.dirname(self.datadir) |
| 107 | print "DBG: found a file" | ||
| 108 | elif os.path.isdir(self.datadir): | 109 | elif os.path.isdir(self.datadir): |
| 109 | self.dirlist = list_dirs(self.datadir) | 110 | self.dirlist = list_dirs(self.datadir) |
| 110 | print "DBG: found a dir" | ||
| 111 | # allow dir* matching through find commands? | 111 | # allow dir* matching through find commands? |
| 112 | else: | 112 | else: |
| 113 | print "ERR: path not understood" | 113 | print "ERR: path not understood" |
| @@ -215,3 +215,9 @@ class bench: · 101 unmodified lines | |||
| 215 | self.dir_exec() | 215 | self.dir_exec() |
| 216 | self.dir_eval() | 216 | self.dir_eval() |
| 217 | self.dir_plot() | 217 | self.dir_plot() |
| 218 | |||
| 219 | def dir_eval_print(self): | ||
| 220 | self.dir_exec() | ||
| 221 | self.dir_eval() | ||
| 222 | self.pretty_print() | ||
| 223 | |||