def get_vdl_log_file(logdirs): """Get logs. Every dir(means `run` in vdl) has only one log(meads `actual log file`). Returns: walks: A dict like {"exp1": "vdlrecords.1587375595.log", "exp2": "vdlrecords.1587375685.log"} """ walks = {} for logdir in logdirs: for root, dirs, files in bfile.walk(logdir): walks.update({root: files}) walks_temp = {} for run, tags in walks.items(): tags_temp = [ tag for tag in tags if is_VDLRecord_file(path=bfile.join(run, tag), check=False) ] tags_temp.sort(reverse=True) if len(tags_temp) > 0: walks_temp.update({run: tags_temp[0]}) return walks_temp
def get_all_walk(self): self.walks = {} for dir in self.dir: for root, dirs, files in bfile.walk(dir): self.walks.update({root: files})