Skip to content

Commit 5e6b8aa

Browse files
committed
Update abacus_dos_run and abacus_run_md
1 parent 7f47b41 commit 5e6b8aa

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/abacusagent/modules/submodules/dos.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ def plot_pdos_species(shifted_energy, orbitals, output_dir, nspin, dpi):
334334
plt.plot(shifted_energy, -pdos_data[1::2], label=f'{species_name} ' + r'$\downarrow$', linestyle='--', linewidth=1.0)
335335

336336
plt.axvline(x=0, color='black', linestyle=':', linewidth=1.0)
337-
plt.xlabel('Energy/eV', fontsize=10)
338-
plt.ylabel('States/eV', fontsize=10)
337+
plt.xlabel('Energy (eV)', fontsize=10)
338+
plt.ylabel(r"States ($eV^{-1}$)", fontsize=10)
339339
plt.xlim(max(min(shifted_energy), -20), min(20, max(shifted_energy)))
340340
if nspin == 1:
341341
plt.ylim(bottom=0)
@@ -382,7 +382,7 @@ def plot_pdos_species_shell(shifted_energy, orbitals, output_dir, nspin, dpi):
382382

383383
ax.axvline(x=0, color='black', linestyle=':', linewidth=1.0)
384384
ax.set_title(f'PDOS for {species}', fontsize=12, pad=10)
385-
ax.set_ylabel('States/eV', fontsize=10)
385+
ax.set_ylabel(r"States ($eV^{-1}$)", fontsize=10)
386386
ax.set_xlim(max(min(shifted_energy), -20), min(20, max(shifted_energy)))
387387
#if nspin == 1:
388388
# ax.set_ylim(bottom=0)
@@ -391,7 +391,7 @@ def plot_pdos_species_shell(shifted_energy, orbitals, output_dir, nspin, dpi):
391391

392392
#ax.set_ylim(bottom=0)
393393

394-
axes[-1].set_xlabel('Energy/eV', fontsize=10)
394+
axes[-1].set_xlabel('Energy (eV)', fontsize=10)
395395

396396
plt.tight_layout()
397397
pdos_pic_file = os.path.join(output_dir, 'PDOS.png')
@@ -460,13 +460,13 @@ def plot_pdos_species_orbital(shifted_energy, orbitals, output_dir, nspin, label
460460
ax.set_xlim(max(min(shifted_energy), -20), min(20, max(shifted_energy)))
461461
if nspin == 1:
462462
ax.set_ylim(bottom=0)
463-
ax.set_ylabel('States/eV', fontsize=10)
463+
ax.set_ylabel(r"States ($eV^{-1}$)", fontsize=10)
464464
ax.legend(fontsize=8, ncol=nspin)
465465
ax.grid(alpha=0.3)
466466

467467
subplot_count += 1
468468

469-
axes[-1].set_xlabel('Energy/eV', fontsize=10)
469+
axes[-1].set_xlabel('Energy (eV)', fontsize=10)
470470

471471
plt.tight_layout()
472472
pdos_pic_file = os.path.join(output_dir, 'PDOS.png')
@@ -500,8 +500,8 @@ def plot_dos(file_path: List[Path],
500500
plt.plot(energy, dos, linestyle='-', label='spin up')
501501
plt.plot(energy, -dos_dn, linestyle='--', label='spin down')
502502
plt.axvline(x=0, color='k', linestyle='--', alpha=0.5)
503-
plt.xlabel('Energy/eV')
504-
plt.ylabel('States/ev')
503+
plt.xlabel('Energy (eV)')
504+
plt.ylabel(r'States ($eV^{-1}$)')
505505
plt.title('Density of States')
506506
plt.grid(True, alpha=0.3)
507507
plt.xlim(x_min, x_max)

src/abacusagent/modules/submodules/md.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
from abacustest.lib_prepare.abacus import ReadInput, WriteInput, AbacusStru
99

1010
from abacusagent.init_mcp import mcp
11-
from abacusagent.modules.util.comm import generate_work_path, link_abacusjob, run_abacus
12-
from abacusagent.modules.submodules.abacus import abacus_collect_data
11+
from abacusagent.modules.util.comm import generate_work_path, link_abacusjob, run_abacus, collect_metrics
1312

1413

1514
def get_last_md_stru(md_stru_outputdir: Path) -> Path:
@@ -181,7 +180,7 @@ def abacus_run_md(
181180

182181
run_abacus(work_path)
183182

184-
metrics = abacus_collect_data(work_path)['collected_metrics']
183+
metrics = collect_metrics(work_path)
185184
suffix = input_params.get('suffix', 'ABACUS')
186185
md_traj_file, traj_frame_nums = convert_md_dump_to_ase_traj(Path(os.path.join(work_path, f'OUT.{suffix}/MD_dump')).absolute())
187186
return {'md_work_path': work_path,

0 commit comments

Comments
 (0)