Coverage for gpaw/test/sjm/test_gpw.py: 38%
13 statements
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-20 00:19 +0000
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-20 00:19 +0000
1import pytest
2from gpaw import restart
3from gpaw.solvation.sjm import SJM
6# Test wrting and reading of the SJM object into the gpw file
7@pytest.mark.old_gpaw_only
8# @pytest.mark.ci
9def test_gpw(in_tmp_dir, atoms):
10 atoms.calc.set(sj={'target_potential': None})
12 E1 = atoms.get_potential_energy()
13 atoms.calc.write('test.gpw', mode='all')
15 atoms2, calc = restart('test.gpw', Class=SJM)
16 E2 = atoms2.get_potential_energy()
17 h = atoms2.calc.stuff_for_hamiltonian[0].effective_potential
18 assert h.unsolv_backside
19 assert E1 == E2