예제 #1
0
 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
예제 #2
0
 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()
예제 #3
0
 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()