def _save_model(self, m): path, filter = QFileDialog.getSaveFileName(caption="Save model", filter=MODEL_FILE_FILTER) print(filter) if path: path = self._correct_path(path, filter, [".zip", ".mdl"]) try: shutil.rmtree(tmp1_path) except FileNotFoundError: pass ds = DynState(tmp1_path) ds.save_model(m) ds.to_zip(path)
def save_simu_history(self): path, filter = QFileDialog.getSaveFileName(caption="Save simulation history", filter=SIMULATION_FILE_FILTER_) if path: path = self._correct_path(path, filter, [".zip", ".mds"]) #shutil.rmtree('./data/tmp1') ds = DynState(tmp_path) if not self.ui.saveAllAtomsPositionCheckBox.checkState(): try: os.remove(tmp_path+'/'+DynState.POS_H) except: pass ds.save_model(self.simulation.model) ds.to_zip(path)