Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebystrom committed Jul 1, 2024
1 parent facd29e commit 0231f63
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions ciderpress/gpaw/tests/test_basic_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ def run_test(self):

class TestEnergy(unittest.TestCase):

# test_sl_gga = generate_test("CIDER23X_SL_GGA", -12.868728302199766)
test_sl_gga = generate_test("CIDER23X_SL_GGA", -12.868728302199766)

# test_nl_gga = generate_test("CIDER23X_NL_GGA", -13.044519201764654)
test_nl_gga = generate_test("CIDER23X_NL_GGA", -13.045337504398542)

# test_sl_mgga = generate_test("CIDER23X_SL_MGGA", -12.267997644473239)
test_sl_mgga = generate_test("CIDER23X_SL_MGGA", -12.267997644473239)

test_nl_mgga = generate_test("CIDER23X_NL_MGGA_DTR", -12.380374553337576)
test_nl_mgga = generate_test("CIDER23X_NL_MGGA_DTR", -12.537128965314368)


if __name__ == "__main__":
Expand Down
40 changes: 20 additions & 20 deletions ciderpress/gpaw/tests/test_si_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from ciderpress.gpaw.calculator import get_cider_functional

USE_STORED_REF = False
USE_STORED_REF = True


def _run_pw_si_stress(xc, use_pp=False, s_numerical=None):
Expand Down Expand Up @@ -76,12 +76,12 @@ def test_nl_gga(self):
if USE_STORED_REF:
s_numerical = np.array(
[
0.00114318,
-0.03307031,
-0.03026228,
-0.0205634,
0.12848806,
0.01003085,
0.00041062,
-0.03364324,
-0.03095064,
-0.02067178,
0.12828351,
0.01013872,
]
)
run_pw_si_stress(xc, s_numerical=s_numerical)
Expand All @@ -93,12 +93,12 @@ def test_nl_mgga(self):
if USE_STORED_REF:
s_numerical = np.array(
[
-0.00745386,
-0.0408426,
-0.03763706,
-0.02227136,
0.14448068,
0.00911011,
-0.00737784,
-0.04081598,
-0.03757383,
-0.0222981,
0.14454075,
0.00917949,
]
)
run_pw_si_stress(xc, s_numerical=s_numerical)
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_sl_mgga(self):
[
-0.01197671,
-0.04729093,
-0.043479,
-0.04347899,
-0.02241506,
0.1438053,
0.00938071,
Expand All @@ -144,12 +144,12 @@ def test_nl_gga_pp(self):
if USE_STORED_REF:
s_numerical = np.array(
[
0.02106118,
-0.0177691,
-0.00961465,
-0.01995931,
0.12498599,
0.01063785,
0.02085583,
-0.01765656,
-0.00976421,
-0.02005148,
0.12475251,
0.01070791,
]
)
run_pw_si_stress(xc, use_pp=True, s_numerical=s_numerical)
Expand Down

0 comments on commit 0231f63

Please sign in to comment.