def __init__(self, path=None): # Create a unique id to identify current serie of job runs self.seriesID = util.random_str(8) print("\nBatch Series ID: %s" % self.seriesID) # Simulation tool to be used self.simtool = None # Config info for detected simulation tool self.config = {} # Variable that holds the name of the 'run_jobs' function to be used self.runjob_func = run_job # True if project is a simulation batch, False otherwise self._batch = False # Simulation run time self.simtime = 0 # Relative path to model file to be used in current run self.model_relpath = None # List of jobs to be run self.jobs = [] # List of dicts containing run summaries for all jobs self.runsummary = [] # Absolute path to base directory for jobs self.jobsdir_abspath = None # Absolute path to jobs results directory self.resultsdir_abspath = None # Name of results database self.db_name = 'SimResults.db' # Name of jobs csv file self.jobscsv_name = 'SimJobs.csv' # Name of results csv file self.resultscsv_name = 'SimResults.csv' # Name of run summary csv file self.runsumcsv_name = 'RunSummary.csv' # List of relative paths to template simulation files self.temp_relpaths = [] # List of parameters found in template files self.temp_params = [] # Relative path to csv file containing list of jobs to be run self.samp_relpath = None # List of parameters found in sample file self.samp_params = [] # Raw sample extracted from csv file. It's a list of dicts with # each dict holding all parameter for a particular job self.sample = [] # Pandas DataFrame for jobs list self.jobs_df = None # Pandas DataFrame for simulation results self.results_df = None # Pandas DataFrame for run summary self.runsum_df = None if path is not None: # Absolute path to simulation project directory self.abspath = os.path.abspath(path) print("\nBPS project directory: " + self.abspath) # Launch method to detect sim tool and store related config info self.check() else: self.abspath = []
def __init__(self, path=None, validCheck=True, seriesID='random', startJobID=1): """Initialization of BPSProject Class Args: path: relative or absolute path to simulation project directory. If not defined here, the "set_projpath" method should be used. validCheck: if True (default), checks validity of inputs seriesID: by default, seriesID is defined automatically (random) However, the user can force the seriesID using this arg. startJobID: by default, the start ID for jobs is 1, but this can be overridden by giving any start number to this arg. """ # Create a unique id to identify current serie of job runs if seriesID == 'random': self.seriesID = util.random_str(8) else: self.seriesID = seriesID print("\nBatch Series ID: %s" % self.seriesID) # Set the start index number for jobs (by default: 1) self.startJobID = startJobID # A flag to enable or disable validity checking self.valid_check = validCheck # Simulation tool to be used self.simtool = None # Config info for detected simulation tool self.config = {} # Variable that holds the name of the 'run_jobs' function to be used self.runjob_func = run_job # True if project is a simulation batch, False otherwise self._batch = False # Simulation run time self.simtime = 0 # Relative path to model file to be used in current run self.model_relpath = None # List of jobs to be run self.jobs = [] # List of dicts containing run summaries for all jobs self.runsummary = [] # Absolute path to base directory for jobs self.jobsdir_abspath = None # Absolute path to jobs results directory self.resultsdir_abspath = None # Name of results database self.db_name = 'SimResults.db' # Name of jobs csv file self.jobscsv_name = 'SimJobs.csv' # Name of results csv file self.resultscsv_name = 'SimResults.csv' # Name of run summary csv file self.runsumcsv_name = 'RunSummary.csv' # List of relative paths to template simulation files self.temp_relpaths = [] # List of parameters found in template files self.temp_params = [] # Relative path to csv file containing list of jobs to be run self.samp_relpath = None # List of parameters found in sample file self.samp_params = [] # Raw sample extracted from csv file. It's a list of dicts with # each dict holding all parameter for a particular job self.sample = [] # Pandas DataFrame for jobs list self.jobs_df = None # Pandas DataFrame for simulation results self.results_df = None # Pandas DataFrame for run summary self.runsum_df = None if path is not None: # Absolute path to simulation project directory self.abspath = os.path.abspath(path) print("\nBPS project directory: " + self.abspath) # Launch method to detect sim tool and store related config info self.check() else: self.abspath = []