Skip to content

Commit

Permalink
Merge pull request #65 from kevinwenminion/devel-1.2.0
Browse files Browse the repository at this point in the history
refine infomation print
  • Loading branch information
kevinwenminion authored Apr 20, 2024
2 parents 7dd9133 + 6652fa2 commit 109af0d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions apex/core/property/EOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
cwd = os.getcwd()
task_list = []
if self.reprod:
logging.info("eos reproduce starts")
print("eos reproduce starts")
if "init_data_path" not in self.parameter:
raise RuntimeError("please provide the initial data path to reproduce")
init_data_path = os.path.abspath(self.parameter["init_data_path"])
Expand All @@ -98,7 +98,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("eos refine starts")
print("eos refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -127,7 +127,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
)

else:
logging.info(
print(
"gen eos from "
+ str(self.vol_start)
+ " to "
Expand All @@ -136,9 +136,9 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
+ str(self.vol_step)
)
if self.vol_abs:
logging.info("treat vol_start and vol_end as absolute volume")
print("treat vol_start and vol_end as absolute volume")
else:
logging.info("treat vol_start and vol_end as relative volume")
print("treat vol_start and vol_end as relative volume")

if self.inter_param["type"] == "abacus":
equi_contcar = os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion apex/core/property/Elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
os.chdir(cwd)

if refine:
logging.info("elastic refine starts")
print("elastic refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down
6 changes: 3 additions & 3 deletions apex/core/property/Gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
cwd = os.getcwd()

if self.reprod:
logging.info("gamma line reproduce starts")
print("gamma line reproduce starts")
if "init_data_path" not in self.parameter:
raise RuntimeError("please provide the initial data path to reproduce")
init_data_path = os.path.abspath(self.parameter["init_data_path"])
Expand All @@ -121,7 +121,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("gamma line refine starts")
print("gamma line refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -247,7 +247,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
os.remove(jj)
task_list.append(output_task)
# print("# %03d generate " % ii, output_task)
logging.info(
print(
"# %03d generate " % count,
output_task,
" \t %d atoms" % len(obtained_slab.sites)
Expand Down
10 changes: 5 additions & 5 deletions apex/core/property/Interstitial.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
cwd = os.getcwd()

if self.reprod:
logging.info("interstitial reproduce starts")
print("interstitial reproduce starts")
if "init_data_path" not in self.parameter:
raise RuntimeError("please provide the initial data path to reproduce")
init_data_path = os.path.abspath(self.parameter["init_data_path"])
Expand All @@ -105,7 +105,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("interstitial refine starts")
print("interstitial refine starts")
self.task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -173,7 +173,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
conv_ss.to("POSCAR", "POSCAR")
ss = conv_ss
if self.lattice_type:
logging.info(msg=f'Adopt user indicated lattice type: {self.lattice_type}')
print(f'Adopt user indicated lattice type: {self.lattice_type}')
self.structure_type = self.lattice_type
os.chdir(cwd)

Expand Down Expand Up @@ -210,7 +210,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
# dss.append(jj.generate_defect_structure(self.supercell))
self.dss = dss

logging.info(
print(
"gen interstitial with supercell "
+ str(self.supercell)
+ " with element "
Expand Down Expand Up @@ -411,7 +411,7 @@ def __gen_tasks(self, interstitial_dict):
with open("POSCAR", "w+") as fout:
for ii in new_pos_line:
print(ii, file=fout)
logging.info(f"gen {type_str}")
print(f"gen {type_str}")
os.chdir(cwd)

total_task = len(self.dss) + len(interstitial_dict)
Expand Down
20 changes: 10 additions & 10 deletions apex/core/property/Phonon.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
cwd = os.getcwd()

if self.reprod:
logging.info("phonon reproduce starts")
print("phonon reproduce starts")
if "init_data_path" not in self.parameter:
raise RuntimeError("please provide the initial data path to reproduce")
init_data_path = os.path.abspath(self.parameter["init_data_path"])
Expand All @@ -124,7 +124,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("phonon refine starts")
print("phonon refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -178,13 +178,13 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
if not self.BAND:
# use seekpath to get band path
if self.seekpath_from_original:
logging.info(msg='Band path (BAND) not indicated, using seekpath from original cell')
print('Band path (BAND) not indicated, using seekpath from original cell')
sp = seekpath.get_path_orig_cell(
self.get_seekpath_structure(ss),
**self.seekpath_param
)
else:
logging.info(msg='Band path (BAND) not indicated, using seekpath for it')
print('Band path (BAND) not indicated, using seekpath for it')
sp = seekpath.get_path(
self.get_seekpath_structure(ss),
**self.seekpath_param
Expand All @@ -193,7 +193,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
self.BAND, self.BAND_LABELS = self.band_list_2_phonopy_band_string(band_list)
else:
# use user input band path
logging.info(msg=f'Band path (BAND) indicated, using: {self.BAND}')
print(f'Band path (BAND) indicated, using: {self.BAND}')
band_list = self.phonopy_band_string_2_band_list(self.BAND, self.BAND_LABELS)

dumpfn(band_list, os.path.join(path_to_work, "band_path.json"), indent=4)
Expand Down Expand Up @@ -503,9 +503,9 @@ def _compute_lower(self, output_file, all_tasks, all_res):
os.system('phonopy -f task.0*/OUT.ABACUS/running_scf.log')
os.system('phonopy -f task.0*/OUT.ABACUS/running_scf.log')
if os.path.exists("FORCE_SETS"):
logging.info('FORCE_SETS is created')
print('FORCE_SETS is created')
else:
logging.info('FORCE_SETS can not be created')
logging.warning('FORCE_SETS can not be created')
os.system('phonopy band.conf --abacus')
os.system('phonopy-bandplot --gnuplot band.yaml > band.dat')

Expand All @@ -524,17 +524,17 @@ def _compute_lower(self, output_file, all_tasks, all_res):
self.supercell_size[1],
self.supercell_size[2]))
os.system('phonopy-bandplot --gnuplot band.yaml > band.dat')
logging.info('band.dat is created')
print('band.dat is created')
shutil.copyfile("band.dat", work_path/"band.dat")

elif self.approach == "displacement":
shutil.copyfile("task.000000/band.conf", "band.conf")
shutil.copyfile("task.000000/phonopy_disp.yaml", "phonopy_disp.yaml")
os.system('phonopy -f task.0*/vasprun.xml')
if os.path.exists("FORCE_SETS"):
logging.info('FORCE_SETS is created')
print('FORCE_SETS is created')
else:
logging.info('FORCE_SETS can not be created')
logging.warning('FORCE_SETS can not be created')
os.system('phonopy --dim="%s %s %s" -c POSCAR-unitcell band.conf' % (
self.supercell_size[0],
self.supercell_size[1],
Expand Down
4 changes: 2 additions & 2 deletions apex/core/property/Surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("surface refine starts")
print("surface refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -174,7 +174,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
if os.path.exists(jj):
os.remove(jj)
task_list.append(output_task)
logging.info(
print(
"# %03d generate " % ii,
output_task,
" \t %d atoms" % len(all_slabs[ii].sites),
Expand Down
6 changes: 3 additions & 3 deletions apex/core/property/Vacancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
cwd = os.getcwd()

if self.reprod:
logging.info("vacancy reproduce starts")
print("vacancy reproduce starts")
if "init_data_path" not in self.parameter:
raise RuntimeError("please provide the initial data path to reproduce")
init_data_path = os.path.abspath(self.parameter["init_data_path"])
Expand All @@ -92,7 +92,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):

else:
if refine:
logging.info("vacancy refine starts")
print("vacancy refine starts")
task_list = make_refine(
self.parameter["init_from_suffix"],
self.parameter["output_suffix"],
Expand Down Expand Up @@ -142,7 +142,7 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
jj.get_supercell_structure(sc_mat=np.diag(self.supercell, k=0))
)

logging.info("gen vacancy with supercell " + str(self.supercell))
print("gen vacancy with supercell " + str(self.supercell))
os.chdir(path_to_work)
if os.path.exists(POSCAR):
os.remove(POSCAR)
Expand Down

0 comments on commit 109af0d

Please sign in to comment.