From fb77fd867da3ca71d8b5db01fd981c28c2049327 Mon Sep 17 00:00:00 2001 From: Xiaojie Wu Date: Wed, 13 Mar 2024 00:18:09 -0700 Subject: [PATCH] skip dftd3 for py3.12 & skip wb97x-d3 --- pyscf/dft/dft_parser.py | 2 +- pyscf/dft/test/test_h2o.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pyscf/dft/dft_parser.py b/pyscf/dft/dft_parser.py index 566965250d..8d702efcbb 100644 --- a/pyscf/dft/dft_parser.py +++ b/pyscf/dft/dft_parser.py @@ -55,7 +55,7 @@ def parse_dft(dft_method): # J. Chem. Theory Comput. 2013, 9, 1, 263–272 if method_lower in ['wb97x-d3']: - return NotADirectoryError('wb97x-d3 is not supported yet.') + raise NotImplementedError('wb97x-d3 is not supported yet.') if method_lower.endswith('-3c'): raise NotImplementedError('*-3c methods are not supported yet.') diff --git a/pyscf/dft/test/test_h2o.py b/pyscf/dft/test/test_h2o.py index 27da5bd418..1c1c1ececf 100644 --- a/pyscf/dft/test/test_h2o.py +++ b/pyscf/dft/test/test_h2o.py @@ -501,6 +501,7 @@ def test_nr_uks_vv10_high_cost(self): method.nlcgrids.atom_grid = {"H": (40, 110), "O": (40, 110),} self.assertAlmostEqual(method.scf(), -76.352381513158718, 8) + @unittest.skipIf('dftd3' not in sys.modules, "requires the dftd3 library") def test_dft_parser(self): from pyscf.scf import dispersion method = dft.RKS(h2o, xc='wb97m-d3bj') @@ -510,13 +511,6 @@ def test_dft_parser(self): fn_facs = method._numint.libxc.parse_xc(method.xc) assert fn_facs[1][0][0] == 531 - method = dft.RKS(h2o, xc='wb97x-d3') - e_disp = dispersion.get_dispersion(method) - self.assertAlmostEqual(e_disp, -1.2566116169235249e-06, 9) - assert method._numint.libxc.is_nlc(method.xc) == False - fn_facs = method._numint.libxc.parse_xc(method.xc) - assert fn_facs[1][0][0] == 399 - method = dft.RKS(h2o, xc='wb97x-d3bj') e_disp = dispersion.get_dispersion(method) self.assertAlmostEqual(e_disp, -0.0005697890844546384, 9)