Skip to content

Commit b24fa2a

Browse files
committed
parity bug fix
1 parent c990fce commit b24fa2a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

asimtools/asimmodules/benchmarking/parity.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ def calc_parity_data(
5353
spvals = []
5454
for i, atoms in enumerate(subset):
5555
calc = load_calc(calc_id)
56+
patoms = atoms.copy()
57+
patoms.calc = calc
5658
n_atoms = len(atoms)
5759
if 'energy' in properties:
5860
prop = 'energy'
5961
ervals = np.hstack(
6062
[ervals, atoms.get_potential_energy()/n_atoms]
6163
)
6264
epvals = np.hstack(
63-
[epvals, float(calc.get_potential_energy(atoms)/n_atoms)]
65+
[epvals, float(patoms.get_potential_energy()/n_atoms)]
6466
)
6567

6668
if 'forces' in properties:
@@ -71,17 +73,16 @@ def calc_parity_data(
7173
)
7274

7375
fpvals = np.hstack(
74-
[fpvals, np.array(calc.get_forces(atoms)).flatten()]
76+
[fpvals, np.array(patoms.get_forces()).flatten()]
7577
)
7678

7779
if 'stress' in properties:
7880
prop = 'stress'
7981
srvals = np.hstack(
80-
[srvals, np.array(atoms.get_stress(voigt=False)).flatten()]
82+
[srvals, np.array(atoms.get_stress(voigt=True)).flatten()]
8183
)
82-
8384
spvals = np.hstack(
84-
[spvals, np.array(calc.get_stress(atoms)).flatten()]
85+
[spvals, np.array(patoms.get_stress(voigt=True)).flatten()]
8586
)
8687
res[prop] = {'ref': srvals, 'pred': spvals}
8788

tests/asimmodules/workflows/test_distributed.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,3 @@ def test_batch_distributed(env_input, calc_input, sim_input, tmp_path, request):
8686
uj = load_job_from_directory(d)
8787
print('job_info:', uj.workdir, uj.get_status())
8888
assert uj.get_status()[1] == statuses[d_ind]
89-
90-
# assert distjob.get_status(descend=False) == (True, 'complete')

0 commit comments

Comments
 (0)