import yaml class InterpolConfig: def __init__(self,config='shit.yml'): with open(config, 'r') as f: self.data = yaml.safe_load(f)['interpolation_config'] if self.data is None: raise Exception("Shit interpolation with shit config; it is not working!!!!") pass def __path(self, path): return self.data['tables_dir'] + path @property def available_data(self) -> str: return self.__path(self.data['available_data']) @property def out_file(self) -> str: return self.__path(self.data['out_file']) @property def available_limit(self) -> int: return int(self.data['available_limit']) @property def total_points(self) -> int: return int(self.data['total_points']) @property def image_data(self): import numpy as np return np.array(self.data['image_data']) @property def std_source(self): """ returns: dataframe with standard deviation source information :) """ import pandas as pd return pd.read_csv(self.__path(self.data['std_dev']))