def _get_next_id(self): if self.directory is None: self.experiment_id = None return if(os.path.isdir(self.directory)==False): os.makedirs(self.directory) logs = os.listdir(self.directory) self.experiment_id = 0 for i in logs: if is_int(i): if int(i) >= self.experiment_id: self.experiment_id = int(i) + 1
def _get_next_id(self): if self.directory is None: self.experiment_id = None return if (os.path.isdir(self.directory) == False): os.makedirs(self.directory) logs = path(self.directory).listdir() self.experiment_id = 0 for d in logs: if is_int(d.name): i = int(d.name) if i >= self.experiment_id: self.experiment_id = i # increment the experiment_id if the current directory is not empty if len(d.listdir()): self.experiment_id += 1 log_path = self.get_log_path() if not log_path.isdir(): log_path.makedirs_p()
def _get_next_id(self): if self.directory is None: self.experiment_id = None return if os.path.isdir(self.directory) == False: os.makedirs(self.directory) logs = path(self.directory).listdir() self.experiment_id = 0 for d in logs: if is_int(d.name): i = int(d.name) if i >= self.experiment_id: self.experiment_id = i # increment the experiment_id if the current directory is not empty if len(d.listdir()): self.experiment_id += 1 log_path = self.get_log_path() if not log_path.isdir(): log_path.makedirs_p()