diff --git a/ciderpress/gpaw/tests/__init__.py b/ciderpress/gpaw/tests/__init__.py index e69de29..46c2b37 100644 --- a/ciderpress/gpaw/tests/__init__.py +++ b/ciderpress/gpaw/tests/__init__.py @@ -0,0 +1,5 @@ +from numpy.testing import assert_allclose + + +def equal(x, y, t): + assert_allclose(x, y, atol=t) diff --git a/ciderpress/gpaw/tests/test_force.py b/ciderpress/gpaw/tests/test_force.py index fd071b5..b77f22e 100644 --- a/ciderpress/gpaw/tests/test_force.py +++ b/ciderpress/gpaw/tests/test_force.py @@ -3,7 +3,7 @@ from ase import Atoms from gpaw import GPAW, PW, FermiDirac -from ciderpress.gpaw.cider_paw import get_cider_functional +from ciderpress.gpaw.calculator import get_cider_functional from ciderpress.gpaw.tests import equal @@ -73,7 +73,7 @@ class TestForce(unittest.TestCase): def test_sl_gga(self): test_cider_forces(get_cider_functional("functionals/CIDER23X_SL_GGA.yaml")) - def test_nl_gga(self): + def test_sl_mgga(self): test_cider_forces(get_cider_functional("functionals/CIDER23X_SL_MGGA.yaml")) def test_nl_gga(self): diff --git a/ciderpress/gpaw/tests/test_read_write.py b/ciderpress/gpaw/tests/test_read_write.py index c9bf97d..3045bc7 100644 --- a/ciderpress/gpaw/tests/test_read_write.py +++ b/ciderpress/gpaw/tests/test_read_write.py @@ -7,8 +7,12 @@ from gpaw.xc.libxc import LibXC from numpy.testing import assert_almost_equal, assert_equal -from ciderpress.gpaw.cider_paw import CiderGPAW, get_cider_functional -from ciderpress.gpaw.interp_paw import DiffGGA, DiffMGGA +from ciderpress.gpaw.calculator import ( + CiderGPAW, + DiffGGA, + DiffMGGA, + get_cider_functional, +) def test_load_write(xc, use_pp=False, is_cider=False, is_nl=False): diff --git a/ciderpress/gpaw/tests/test_si_stress.py b/ciderpress/gpaw/tests/test_si_stress.py index 3f3281e..a5767bd 100644 --- a/ciderpress/gpaw/tests/test_si_stress.py +++ b/ciderpress/gpaw/tests/test_si_stress.py @@ -6,7 +6,7 @@ from gpaw import GPAW, PW, Mixer from gpaw.mpi import world -from ciderpress.gpaw.cider_paw import get_cider_functional +from ciderpress.gpaw.calculator import get_cider_functional def test_pw_si_stress(xc, use_pp=False, s_numerical=None): @@ -66,17 +66,19 @@ def get_xc(fname, use_paw=True): class TestStress(unittest.TestCase): def test_nl_gga(self): xc = get_xc("functionals/CIDER23X_NL_GGA.yaml") - s_numerical = np.array( - [-0.00261187, -0.03790705, -0.03193711, -0.0209582, 0.13427714, 0.00928778] - ) - test_pw_si_stress(xc, s_numerical=s_numerical) + # s_numerical = np.array( + # [-0.00261187, -0.03790705, -0.03193711, -0.0209582, 0.13427714, 0.00928778] + # ) + # test_pw_si_stress(xc, s_numerical=s_numerical) + test_pw_si_stress(xc, s_numerical=None) def test_nl_mgga(self): xc = get_xc("functionals/CIDER23X_NL_MGGA_DTR.yaml") - s_numerical = np.array( - [-0.00681636, -0.04026119, -0.03689781, -0.02227667, 0.14441494, 0.00907815] - ) - test_pw_si_stress(xc, s_numerical=s_numerical) + # s_numerical = np.array( + # [-0.00681636, -0.04026119, -0.03689781, -0.02227667, 0.14441494, 0.00907815] + # ) + # test_pw_si_stress(xc, s_numerical=s_numerical) + test_pw_si_stress(xc, s_numerical=None) def test_sl_gga(self): xc = get_xc("functionals/CIDER23X_SL_GGA.yaml")