Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apex/core/property/Gruneisen.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ def _ensure_abacus_volume_outputs(
if not os.path.isfile("FORCE_CONSTANTS"):
raise FileNotFoundError(f"FORCE_CONSTANTS was not created in {helper_dir}")
if not os.path.isfile("mesh.yaml"):
subprocess.check_call(Phonon.phonopy_command("band.conf"), shell=True)
subprocess.check_call(Phonon.phonopy_command("phonopy_disp.yaml --config band.conf"), shell=True)
self._write_band_dat()
finally:
os.chdir(cwd)
Expand Down
2 changes: 1 addition & 1 deletion apex/core/property/Phonon.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def _compute_lower(self, output_file, all_tasks, all_res):
if not os.path.exists("FORCE_SETS"):
raise FileNotFoundError("FORCE_SETS was not created")
print('FORCE_SETS is created')
subprocess.check_call(self.phonopy_command("band.conf"), shell=True)
subprocess.check_call(self.phonopy_command("phonopy_disp.yaml --config band.conf"), shell=True)
self.write_band_dat()

elif self.inter_param["type"] == 'vasp':
Expand Down
9 changes: 6 additions & 3 deletions tests/test_gruneisen.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def fake_check_call(command, shell):
Path("FORCE_SETS").write_text("fake force sets\n")
elif command == Phonon.phonopy_setup_command("phonopy_disp.yaml --writefc"):
Path("FORCE_CONSTANTS").write_text("fake force constants\n")
elif command == Phonon.phonopy_command("band.conf"):
elif command == Phonon.phonopy_command("phonopy_disp.yaml --config band.conf"):
strain = loadfn("volume.json")["strain"]
if strain < 0:
frequencies = [4.2, 8.4]
Expand Down Expand Up @@ -459,8 +459,11 @@ def fake_run(command, stdout, stderr, text):
]),
3,
)
self.assertEqual(len([cmd for _, cmd in calls if cmd == Phonon.phonopy_command("band.conf")]), 3)
self.assertFalse(any(cmd == "phonopy band.conf --abacus" for _, cmd in calls))
self.assertEqual(
len([cmd for _, cmd in calls if cmd == Phonon.phonopy_command("phonopy_disp.yaml --config band.conf")]),
3,
)
self.assertFalse(any(cmd == "phonopy phonopy_disp.yaml --config band.conf --abacus" for _, cmd in calls))
self.assertTrue((work_dir / "volume.000000" / "mesh.yaml").is_file())
self.assertTrue((work_dir / "volume.000001" / "band.dat").is_file())
self.assertTrue("Temperature(K) SumGammaCv Sign" in ptr)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_phonon.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def fake_check_call(command, shell):
calls.append(command)
if command.startswith(Phonon.phonopy_setup_command("-f")):
Path("FORCE_SETS").write_text("fake force sets\n")
elif command == Phonon.phonopy_command("band.conf"):
elif command == Phonon.phonopy_command("phonopy_disp.yaml --config band.conf"):
Path("band.yaml").write_text("phonon: []\n")

try:
Expand All @@ -349,8 +349,8 @@ def fake_check_call(command, shell):
patch.object(Phonon, "write_band_dat", side_effect=self._write_band_dat_for_compute):
phonon._compute_lower(str(work_dir / "result.json"), [str(task_dir)], [])
self.assertEqual(calls[0], Phonon.phonopy_setup_command("-f task.0*/OUT.ABACUS/running_scf.log"))
self.assertEqual(calls[1], Phonon.phonopy_command("band.conf"))
self.assertFalse(any("--abacus" in command and command.startswith("phonopy band.conf") for command in calls))
self.assertEqual(calls[1], Phonon.phonopy_command("phonopy_disp.yaml --config band.conf"))
self.assertFalse(any("--abacus" in command and "band.conf" in command for command in calls))
finally:
shutil.rmtree(work_dir, ignore_errors=True)

Expand Down