def initialize(self): """ Function to call the initialize function on the Params object of the StorageVET application Part of the MenuBar """ self.statProgress.reset() self.stackedWidgets.setCurrentIndex(0) if self.inputFileName: if self.inputFileName.endswith(".csv"): self.inputFileName = Params.csv_to_xml(self.inputFileName) # Initialize the Input Object from Model Parameters and Simulation Cases Params.initialize(self.inputFileName, schema_rel_path) self.init = True self.msgBox.setText( 'Successfully initialized the Params class with the XML file.') self.msgBox.exec_() gLogger.info( 'User successfully initialized the Params class with the XML file.' ) else: # Look for proper ways so that the Params initialize errors from StorageVET side can be reported to # SVETapp main window text; currently, SVETapp window just exited without any messages... self.msgBox.setText('Params has not been initialized to validate.') self.msgBox.exec_() gLogger.info('User has not given an input file to initialize.')
def __init__(self, model_parameters_path, verbose=False): """ Constructor to initialize the parameters and data needed to run StorageVET. Initialize the Params Object from Model Parameters Args: model_parameters_path (str): Filename of the model parameters CSV or XML that describes the case to be analysed """ self.verbose = verbose # Initialize the Params Object from Model Parameters self.case_dict = Params.initialize( model_parameters_path, verbose) # unvalidated case instances self.results = Result.initialize(Params.results_inputs, Params.case_definitions) if verbose: self.visualization = Visualization(Params) self.visualization.class_summary()