def save_indicators(self, file: PurePath): self.is_indicators_updated = False self.__indicators_file = file wildcards = { k: ind.to_dict() for k, ind in self.dot_indicators.items() } inds = {k: ind.to_dict() for k, ind in self.indicators.items()} with open(str(file), "w") as file: file.write( util.yaml_dump({ 'wildcards': wildcards, 'indicators': inds }))
def save_artifactors(self, file: PurePath): self.__artifacts_file = file artifacts = {k: art.to_dict() for k, art in self.artifacts.items()} with open(str(file), "w") as file: file.write(util.yaml_dump(artifacts))
def save_indicators(self, file: PurePath): self.__indicators_file = file indicators = {k: ind.to_dict() for k, ind in self.indicators.items()} with open(str(file), "w") as file: file.write(util.yaml_dump(indicators))
def append_to_file(self, line, filename): makedirs(self.save_dir, exist_ok=True) file = PurePath(self.save_dir, filename + '.csv') with open(file, 'a', encoding='utf-8') as file: file.write(line)