def savePipeline(self): """ Save a workflow pipeline from UI as a yaml file """ save_file = QtGui.QFileDialog.getSaveFileName(None, 'Save tomography pipeline file as', os.path.expanduser('~'), selectedFilter='*.yml')[0] save_file = save_file.split('.')[0] + '.yml' with open(save_file, 'w') as yml: pipeline = config.extract_pipeline_dict(self.manager.features) yamlmod.ordered_dump(pipeline, yml)
def save_function_pipeline(pipeline, file_name): """ Save a workflow pipeline from dict Parameters ---------- pipeline : dict dictionary specifying the workflow pipeline file_name : str file name to save as yml """ if file_name != '': file_name = file_name.split('.')[0] + '.yml' with open(file_name, 'w') as y: yamlmod.ordered_dump(pipeline, y)