def paginate(self): """Make folders where we would like to put results etc.""" project_dir = self.project_dir raw_dir = self.raw_dir batch_dir = self.batch_dir if project_dir is None: raise UnderDefined("no project directory defined") if raw_dir is None: raise UnderDefined("no raw directory defined") if batch_dir is None: raise UnderDefined("no batch directory defined") # create the folders if not os.path.isdir(project_dir): os.mkdir(project_dir) logging.info(f"created folder {project_dir}") if not os.path.isdir(batch_dir): os.mkdir(batch_dir) logging.info(f"created folder {batch_dir}") if not os.path.isdir(raw_dir): os.mkdir(raw_dir) logging.info(f"created folder {raw_dir}") self.project_dir = project_dir self.batch_dir = batch_dir self.raw_dir = raw_dir return project_dir, batch_dir, raw_dir
def generate_file_name(self): """generate a suitable file name for the experiment""" if not self.project: raise UnderDefined("project name not given") out_data_dir = prms.Paths.outdatadir project_dir = os.path.join(out_data_dir, self.project) file_name = "cellpy_batch_%s.json" % self.name self.file_name = os.path.join(project_dir, file_name)
def do(self): if not self.experiments: raise UnderDefined( "cannot run until you have assigned an experiment") for engine in self.engines: self.empty_the_farms() logging.debug(f"running - {str(engine)}") self.run_engine(engine) for dumper in self.dumpers: logging.debug(f"exporting - {str(dumper)}") self.run_dumper(dumper)