|
1 | 1 | import os |
2 | 2 | from pathlib import Path |
| 3 | +from tempfile import TemporaryDirectory |
3 | 4 |
|
4 | 5 | import pytest |
5 | 6 | from ase.calculators.calculator import Calculator |
6 | | -from jobflow import Flow, run_locally |
| 7 | +from jobflow import Flow, JobStore, run_locally |
7 | 8 | from numpy.testing import assert_allclose |
8 | 9 | from pymatgen.core.structure import Structure |
9 | 10 | from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine |
@@ -113,6 +114,26 @@ def test_phonon_wf_force_field( |
113 | 114 | ): |
114 | 115 | # TODO brittle due to inability to adjust dtypes in CHGNetRelaxMaker |
115 | 116 |
|
| 117 | + # See issue: https://github.com/materialsproject/atomate2/issues/1395 |
| 118 | + # Testing JSON store explicitly to avoid regression for this flow |
| 119 | + json_dir = TemporaryDirectory() |
| 120 | + json_store = JobStore.from_dict_spec( |
| 121 | + { |
| 122 | + "docs_store": { |
| 123 | + "type": "JSONStore", |
| 124 | + "paths": str(Path(json_dir.name) / "output.json"), |
| 125 | + "read_only": False, |
| 126 | + }, |
| 127 | + "additional_stores": { |
| 128 | + "data": { |
| 129 | + "type": "JSONStore", |
| 130 | + "paths": str(Path(json_dir.name) / "blob_output.json"), |
| 131 | + "read_only": False, |
| 132 | + } |
| 133 | + }, |
| 134 | + } |
| 135 | + ) |
| 136 | + |
116 | 137 | phonon_kwargs = dict( |
117 | 138 | use_symmetrized_structure="conventional", |
118 | 139 | create_thermal_displacements=False, |
@@ -146,7 +167,12 @@ def test_phonon_wf_force_field( |
146 | 167 | flow = phonon_maker.make(si_structure) |
147 | 168 |
|
148 | 169 | # run the flow or job and ensure that it finished running successfully |
149 | | - responses = run_locally(flow, create_folders=True, ensure_success=True) |
| 170 | + responses = run_locally( |
| 171 | + flow, create_folders=True, ensure_success=True, store=json_store |
| 172 | + ) |
| 173 | + |
| 174 | + # close temp dir for JSON store |
| 175 | + json_dir.cleanup() |
150 | 176 |
|
151 | 177 | # validate the outputs |
152 | 178 | ph_bs_dos_doc = responses[flow[-1].uuid][1].output |
|
0 commit comments