def __init__(self, in_settings=None): self._settings = True if in_settings is None: # call for documentation only self._settings = False self.ts = 0 self.settings_types['log_file'] = 'str' self.settings_default['log_file'] = 'log' if self._settings: self.settings = in_settings self.settings['SHARPy']['flow'] = self.settings['SHARPy']['flow'] settings.to_custom_types(self.settings['SHARPy'], self.settings_types, self.settings_default) cout.cout_wrap.initialise(self.settings['SHARPy']['write_screen'], self.settings['SHARPy']['write_log'], self.settings['SHARPy']['log_folder'], self.settings['SHARPy']['log_file']) self.case_route = in_settings['SHARPy']['route'] + '/' self.case_name = in_settings['SHARPy']['case'] for solver_name in in_settings['SHARPy']['flow']: try: dict_of_solvers[solver_name] except KeyError: exceptions.NotImplementedSolver(solver_name)
def __init__(self, in_settings): self.ts = 0 self.settings_types = dict() self.settings_default = dict() self.settings_types['flow'] = 'list(str)' self.settings_default['flow'] = None self.settings_types['case'] = 'str' self.settings_default['case'] = 'default_case_name' self.settings_types['route'] = 'str' self.settings_default['route'] = None self.settings_types['write_screen'] = 'bool' self.settings_default['write_screen'] = True self.settings_types['write_log'] = 'bool' self.settings_default['write_log'] = False self.settings_types['log_folder'] = 'str' self.settings_default['log_folder'] = '' self.settings_types['log_file'] = 'str' self.settings_default['log_file'] = 'log' self.settings = in_settings self.settings['SHARPy']['flow'] = self.settings['SHARPy']['flow'] settings.to_custom_types(self.settings['SHARPy'], self.settings_types, self.settings_default) cout.cout_wrap.initialise(self.settings['SHARPy']['write_screen'], self.settings['SHARPy']['write_log'], self.settings['SHARPy']['log_folder'], self.settings['SHARPy']['log_file']) self.case_route = in_settings['SHARPy']['route'] + '/' self.case_name = in_settings['SHARPy']['case'] for solver_name in in_settings['SHARPy']['flow']: try: dict_of_solvers[solver_name] except KeyError: exceptions.NotImplementedSolver(solver_name)