def to_and_from_dict_verify(self, qctask): """ Helper function. This function should be called in each specific test. """ d1 = qctask.to_dict qc2 = QcTask.from_dict(d1) d2 = qc2.to_dict self.assertEqual(d1, d2)
def from_dict(cls, d): h = QChemErrorHandler(input_file=d["input_file"], output_file=d["output_file"], ex_backup_list=d["ex_backup_list"], rca_gdm_thresh=d["rca_gdm_thresh"], scf_max_cycles=d["scf_max_cycles"], geom_max_cycles=d["geom_max_cycles"]) h.outdata = d["outdata"] h.qcinp = QcInput.from_dict(d["qcinp"]) if d["qcinp"] else None h.error_step_id = d["error_step_id"] h.errors = d["errors"] h.fix_step = QcTask.from_dict(d["fix_step"]) if d["fix_step"] else None return h