From a525c0cc2ebe3d26dc281ddbaf00a12852e3acdf Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Thu, 9 Nov 2023 23:24:05 -0800 Subject: [PATCH] Update Mole.loads method for backward compatibility --- pyscf/gto/mole.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyscf/gto/mole.py b/pyscf/gto/mole.py index 49f7fe9f34..619e36c242 100644 --- a/pyscf/gto/mole.py +++ b/pyscf/gto/mole.py @@ -1292,7 +1292,10 @@ def loads(molstr): mol.atom = eval(mol.atom) mol.basis= eval(mol.basis) mol.ecp = eval(mol.ecp) - mol.pseudo = eval(mol.pseudo) + if 'pseudo' in moldic: + # backward compatibility with old dumps function, which does not have + # the pseudo attribute + mol.pseudo = eval(mol.pseudo) mol._atm = numpy.array(mol._atm, dtype=numpy.int32) mol._bas = numpy.array(mol._bas, dtype=numpy.int32) mol._env = numpy.array(mol._env, dtype=numpy.double)