pwact 0.1.24__py3-none-any.whl → 0.1.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pwact/active_learning/explore/run_model_md.py +17 -0
- pwact/active_learning/user_input/cmd_infos.py +8 -4
- pwact/utils/file_operation.py +6 -1
- pwact/utils/tmp.py +38 -4
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/METADATA +1 -1
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/RECORD +10 -10
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/LICENSE +0 -0
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/WHEEL +0 -0
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/entry_points.txt +0 -0
- {pwact-0.1.24.dist-info → pwact-0.1.26.dist-info}/top_level.txt +0 -0
|
@@ -26,6 +26,7 @@ from pwact.utils.constant import AL_STRUCTURE, TEMP_STRUCTURE, EXPLORE_FILE_STRU
|
|
|
26
26
|
from pwact.utils.format_input_output import get_iter_from_iter_name, get_sub_md_sys_template_name,\
|
|
27
27
|
make_md_sys_name, get_md_sys_template_name, make_temp_press_name, make_temp_name, make_train_name
|
|
28
28
|
from pwact.utils.file_operation import write_to_file, add_postfix_dir, link_file, read_data, search_files, copy_dir, copy_file, del_file, del_dir, del_file_list, del_file_list_by_patten, mv_file
|
|
29
|
+
from pwact.utils.draw.hist_model_devi import draw_hist_list
|
|
29
30
|
from pwact.utils.app_lib.lammps import make_lammps_input
|
|
30
31
|
from pwact.data_format.configop import save_config, get_atom_type
|
|
31
32
|
|
|
@@ -288,7 +289,16 @@ class Explore(object):
|
|
|
288
289
|
'''
|
|
289
290
|
def post_process_md(self):
|
|
290
291
|
md_sys_dir_list = search_files(self.md_dir, get_md_sys_template_name())
|
|
292
|
+
# draw model deviation
|
|
291
293
|
is_kpu = self.input_param.strategy.uncertainty.upper() == UNCERTAINTY.kpu.upper()
|
|
294
|
+
if is_kpu is False:
|
|
295
|
+
for md_sys_dir in md_sys_dir_list:
|
|
296
|
+
draw_hist_list(file_path=[md_sys_dir],
|
|
297
|
+
legend_label=["{}-{}".format(self.itername, os.path.basename(md_sys_dir))],
|
|
298
|
+
save_path = os.path.join(md_sys_dir, "model_devi_distribution.png"),
|
|
299
|
+
low=self.input_param.strategy.lower_model_deiv_f,
|
|
300
|
+
high=self.input_param.strategy.upper_model_deiv_f)
|
|
301
|
+
|
|
292
302
|
for md_sys_dir in md_sys_dir_list:
|
|
293
303
|
sub_md_sys_dir_list =search_files(md_sys_dir, get_md_sys_template_name())
|
|
294
304
|
for sub_md_sys in sub_md_sys_dir_list:
|
|
@@ -313,6 +323,13 @@ class Explore(object):
|
|
|
313
323
|
copy_file(file, os.path.join(self.real_md_dir, os.path.basename(file)))
|
|
314
324
|
for file in md_slurm_scripts:
|
|
315
325
|
copy_file(file, os.path.join(self.real_md_dir, os.path.basename(file)))
|
|
326
|
+
if os.path.exists(os.path.join(md_sys_dir, "model_devi_distribution.png")):
|
|
327
|
+
copy_file(os.path.join(md_sys_dir, "model_devi_distribution.png"),
|
|
328
|
+
os.path.join(self.real_md_dir, os.path.basename(md_sys_dir), "model_devi_distribution.png"))
|
|
329
|
+
link_file(
|
|
330
|
+
os.path.join(self.real_md_dir, os.path.basename(md_sys_dir), "model_devi_distribution.png"),
|
|
331
|
+
os.path.join(self.select_dir, "model_devi_distribution-{}.png".format(os.path.basename(md_sys_dir)))
|
|
332
|
+
)
|
|
316
333
|
copy_dir(self.select_dir, self.real_select_dir)
|
|
317
334
|
|
|
318
335
|
'''
|
|
@@ -21,19 +21,23 @@ def cmd_infos(cmd_type=None):
|
|
|
21
21
|
cmd_info += "'pwact kill init_bulk' for 'init_bulk' tasks\n"
|
|
22
22
|
cmd_info += "'pwact kill run' for 'run' tasks\n\n"
|
|
23
23
|
|
|
24
|
+
cmd_info += "gather_pwdata".lower() + "\n"
|
|
25
|
+
cmd_info += "you could use this method to extract pwdatas after active learing done.\nFor more detail for this command, you could use 'pwact gather_pwdata -h'\n\n"
|
|
26
|
+
|
|
27
|
+
cmd_info += "filter" + "\n"
|
|
28
|
+
cmd_info += "you could use this method to test the selection results corresponding to the upper and lower limit settings, you could use 'pwact filter -h'\n"
|
|
29
|
+
|
|
24
30
|
cmd_info += "to_pwdata".lower() + "\n"
|
|
25
31
|
cmd_info += "(This method has been abandoned, new conversion methods refer to the pwdata documentation http://doc.lonxun.com/PWMLFF/Appendix-2/)\n\n"
|
|
26
|
-
cmd_info += "you could use this method to change outcars or movements to pwdata format.\nFor more detail for this command, you could use '
|
|
32
|
+
cmd_info += "you could use this method to change outcars or movements to pwdata format.\nFor more detail for this command, you could use 'pwact to_pwdata -h'\n\n"
|
|
27
33
|
|
|
28
|
-
cmd_info += "gather_pwdata".lower() + "\n"
|
|
29
|
-
cmd_info += "you could use this method to extract pwdatas after active learing done.\nFor more detail for this command, you could use 'PWact gather_pwdata -h'\n\n"
|
|
30
|
-
|
|
31
34
|
cmd_info += "\n\n"
|
|
32
35
|
cmd_info += "examples of pwact are located at the dir 'pwact/example'\n"
|
|
33
36
|
cmd_info += "you can alse download them from github link:\n"
|
|
34
37
|
cmd_info += "https://github.com/LonxunQuantum/PWact/tree/main/pwact/example\n\n"
|
|
35
38
|
cmd_info += "or download from BaiduNetdisk included the calculation results of examples:\n"
|
|
36
39
|
cmd_info += "https://pan.baidu.com/s/14E0u_7cpntiBZgg-C1S5XA?pwd=pwmt\n\n"
|
|
40
|
+
|
|
37
41
|
elif cmd_type == "init_bulk":
|
|
38
42
|
cmd_info = cmd_info_init_bulk()
|
|
39
43
|
elif cmd_type == "run":
|
pwact/utils/file_operation.py
CHANGED
|
@@ -65,7 +65,12 @@ def file_read_lines(file_path, data_type="float"):
|
|
|
65
65
|
|
|
66
66
|
'''
|
|
67
67
|
description:
|
|
68
|
-
load txt data
|
|
68
|
+
load txt data: the content as :
|
|
69
|
+
# step avg_devi_f min_devi_f max_devi_f avg_devi_e min_devi_e max_devi_e
|
|
70
|
+
0 0.016176053 0.000004773 0.023921006 0.494110683 0.007786004 0.680908664
|
|
71
|
+
10 0.020843630 0.000576891 0.033193308 0.481147298 0.001424875 0.696843965
|
|
72
|
+
20 0.020738273 0.001127881 0.031809715 0.478043120 0.001433802 0.703810561
|
|
73
|
+
...
|
|
69
74
|
param {str} file_path
|
|
70
75
|
param {*} skiprows
|
|
71
76
|
return {*}
|
pwact/utils/tmp.py
CHANGED
|
@@ -2,8 +2,8 @@ from pwdata import Config
|
|
|
2
2
|
import os, sys, glob
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
5
|
-
def count_pwdata():
|
|
6
|
-
|
|
5
|
+
def count_pwdata(work_dir):
|
|
6
|
+
|
|
7
7
|
dir_list = glob.glob(os.path.join(work_dir, "*"))
|
|
8
8
|
res = []
|
|
9
9
|
for dir in dir_list:
|
|
@@ -24,6 +24,40 @@ def count_outmlmd():
|
|
|
24
24
|
mlmds = glob.glob(os.path.join(work_dir, "*/*/*/OUT.MLMD"))
|
|
25
25
|
print(len(mlmds))
|
|
26
26
|
|
|
27
|
+
def save_mlmd():
|
|
28
|
+
work_dir = "/data/home/wuxingxing/datas/debugs/dengjiapei/run_iter"
|
|
29
|
+
data_list = glob.glob(os.path.join(work_dir, "iter.*/label/scf/*/*/*/OUT.MLMD"))
|
|
30
|
+
datasets_path = "/data/home/wuxingxing/datas/debugs/dengjiapei/run_iter/mlmd_pwdata"
|
|
31
|
+
# data_name = datasets_path
|
|
32
|
+
image_data = None
|
|
33
|
+
for data_path in data_list:
|
|
34
|
+
if image_data is not None:
|
|
35
|
+
tmp_config = Config("pwmat/movement", data_path)
|
|
36
|
+
# if not isinstance(tmp_config, list):
|
|
37
|
+
# tmp_config = [tmp_config]
|
|
38
|
+
image_data.images.extend(tmp_config.images)
|
|
39
|
+
else:
|
|
40
|
+
image_data = Config("pwmat/movement", data_path)
|
|
41
|
+
|
|
42
|
+
if not isinstance(image_data.images, list):
|
|
43
|
+
image_data.images = [image_data.images]
|
|
44
|
+
|
|
45
|
+
# if not isinstance(image_data, list):
|
|
46
|
+
# image_data = [image_data]
|
|
47
|
+
image_data.to(
|
|
48
|
+
output_path=datasets_path,
|
|
49
|
+
save_format="pwmlff/npy",
|
|
50
|
+
train_ratio = 0.8,
|
|
51
|
+
train_data_path="train",
|
|
52
|
+
valid_data_path="valid",
|
|
53
|
+
random=True,
|
|
54
|
+
seed = 2024,
|
|
55
|
+
retain_raw = False
|
|
56
|
+
)
|
|
57
|
+
print(len(image_data.images))
|
|
58
|
+
|
|
59
|
+
|
|
27
60
|
if __name__=="__main__":
|
|
28
|
-
count_pwdata()
|
|
29
|
-
count_outmlmd()
|
|
61
|
+
count_pwdata(work_dir = "/data/home/wuxingxing/datas/debugs/dengjiapei/run_iter/mlmd_pwdata")
|
|
62
|
+
# count_outmlmd()
|
|
63
|
+
# save_mlmd()
|
|
@@ -3,7 +3,7 @@ pwact/main.py,sha256=EKFcwo_gk9BWhg3zU36RW7NXMLDfyhzrtjtvcv4h5dQ,17036
|
|
|
3
3
|
pwact/active_learning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
pwact/active_learning/environment.py,sha256=KvyMaOXrM-HMMma4SnoOQFO6fZxDsk0Fsyyy7xqfGCo,684
|
|
5
5
|
pwact/active_learning/explore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
pwact/active_learning/explore/run_model_md.py,sha256=
|
|
6
|
+
pwact/active_learning/explore/run_model_md.py,sha256=opflniIxbT8SSPNwkGXcd8j_GVpWvDexhFhxYXXO8Yk,21053
|
|
7
7
|
pwact/active_learning/explore/select_image.py,sha256=dmsMoxFwQ7JDPHK2vRFzUfXeEovT86cmUnmEm-qrfwE,12665
|
|
8
8
|
pwact/active_learning/init_bulk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
pwact/active_learning/init_bulk/aimd.py,sha256=XzDlX2vylaljQKoUnv6nrI2NfiOdHZpq8qr3DenA1F4,10465
|
|
@@ -22,7 +22,7 @@ pwact/active_learning/train/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
|
22
22
|
pwact/active_learning/train/dp_kpu.py,sha256=GkGKEGhLmOvPERqgTkf_0_vD9zOEPlBX2N7vuSQG_-c,9317
|
|
23
23
|
pwact/active_learning/train/train_model.py,sha256=NXqTKrl7Lb_UGt2-Lq_gLM9iZDAZFY09nxP_aGtBdrE,10525
|
|
24
24
|
pwact/active_learning/user_input/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
-
pwact/active_learning/user_input/cmd_infos.py,sha256=
|
|
25
|
+
pwact/active_learning/user_input/cmd_infos.py,sha256=3oWe9AhCxM9rWcRs3bezD7pb1TC5o0bCcvg-k36xEPY,3726
|
|
26
26
|
pwact/active_learning/user_input/init_bulk_input.py,sha256=NCUAB1xpa67MXHRRWAkmWZjkQbTibE4EjmtlOmr0HdQ,6762
|
|
27
27
|
pwact/active_learning/user_input/iter_input.py,sha256=zwFCI6dDFIEVWitEqBBZP7TtrSvxMbmSUEPiM0Z8ZOk,10732
|
|
28
28
|
pwact/active_learning/user_input/resource.py,sha256=bg1rkdjIzuj7pDUvp6h1yMWFT0PqYzH4BfX5tJ7MZzc,6812
|
|
@@ -40,22 +40,22 @@ pwact/data_format/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
40
40
|
pwact/data_format/configop.py,sha256=S2WaES4-9_FX_o6fLaBMw2uSIF1cUMLGj9APRRASy6Q,11984
|
|
41
41
|
pwact/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
42
|
pwact/utils/constant.py,sha256=ZM43rI0JNHA_nVKdRW1YvPGCEkomRNgdmA3_L8hAVSY,18379
|
|
43
|
-
pwact/utils/file_operation.py,sha256=
|
|
43
|
+
pwact/utils/file_operation.py,sha256=LFQ247afF_nUhxagZTYqIYs9GrJCwsiI2EuDhoxWIKQ,9032
|
|
44
44
|
pwact/utils/format_input_output.py,sha256=oYFydQy3-btXzieO2O2LbHFoeRyhPnLVE4c5TNgS-IQ,1798
|
|
45
45
|
pwact/utils/json_operation.py,sha256=BqBsnIjk1URoMW_s2yu7Gk8IBxlir-oo6ivt8P3RIqg,1794
|
|
46
46
|
pwact/utils/pre_al_data_util.py,sha256=QE-axnVYUIyORFiVs-WK9-UaJlMUFY816_rSyYOOJc8,2542
|
|
47
47
|
pwact/utils/process_tool.py,sha256=trzp6GbP_SYFiS_vheobV_FI4PSWVJvX3xHsFQ6DWME,478
|
|
48
48
|
pwact/utils/slurm_script.py,sha256=mgueOrhYteg6XXvJitdjmbV4lzxMujuna9Jxr3wgC7Q,8237
|
|
49
|
-
pwact/utils/tmp.py,sha256=
|
|
49
|
+
pwact/utils/tmp.py,sha256=en_GltoNwfA40vSHttMRi9cEg-8xnPZlvnnBq1_vHfw,2285
|
|
50
50
|
pwact/utils/app_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
pwact/utils/app_lib/common.py,sha256=lQmI-9Qumq62MNjr-eVlLL88ISDHBOb6vAfYYFcDIgM,6040
|
|
52
52
|
pwact/utils/app_lib/cp2k.py,sha256=ljhCCHmZ2kfoXEXn5O7-D56EgTLn2a7H3y_TIkHiasY,13157
|
|
53
53
|
pwact/utils/app_lib/cp2k_dp.py,sha256=VP4gyPGhLcMAqAjrqCQSUiiGlESNlyYz7Gs3Q4QoUHo,6912
|
|
54
54
|
pwact/utils/app_lib/lammps.py,sha256=2oxHJHdDxfDDWWmnjo0gMNwgGvxABwuDgDlb8kbhgfk,8037
|
|
55
55
|
pwact/utils/app_lib/pwmat.py,sha256=PTRPkG_d00ibGhpCe2-4M7MW3dx2ZuAyb9hT2jl_LAs,18047
|
|
56
|
-
pwact-0.1.
|
|
57
|
-
pwact-0.1.
|
|
58
|
-
pwact-0.1.
|
|
59
|
-
pwact-0.1.
|
|
60
|
-
pwact-0.1.
|
|
61
|
-
pwact-0.1.
|
|
56
|
+
pwact-0.1.26.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
57
|
+
pwact-0.1.26.dist-info/METADATA,sha256=8wGRhGuChezjba5MhX5Sk4xWOWuBIs1tmzdiSFHckcU,3659
|
|
58
|
+
pwact-0.1.26.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
59
|
+
pwact-0.1.26.dist-info/entry_points.txt,sha256=p61auAnpbn8E2WjvHNBA7rb9_NRAOCew4zdcCj33cGc,42
|
|
60
|
+
pwact-0.1.26.dist-info/top_level.txt,sha256=fY1_7sH5Lke4dC9L8MbYM4fT5aat5eCkAmpkIzY1SlM,6
|
|
61
|
+
pwact-0.1.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|