pwact 0.1.23__py3-none-any.whl → 0.1.24__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/label/labeling.py +16 -7
- pwact/active_learning/user_input/cmd_infos.py +1 -1
- pwact/data_format/configop.py +23 -48
- pwact/utils/tmp.py +29 -0
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/METADATA +1 -1
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/RECORD +10 -9
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/LICENSE +0 -0
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/WHEEL +0 -0
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/entry_points.txt +0 -0
- {pwact-0.1.23.dist-info → pwact-0.1.24.dist-info}/top_level.txt +0 -0
|
@@ -245,7 +245,7 @@ class Labeling(object):
|
|
|
245
245
|
for sub_md_sys in sub_md_sys_dir_list:
|
|
246
246
|
out_mlmd_list =search_files(sub_md_sys, "*-{}/{}".format(LABEL_FILE_STRUCTURE.scf, DFT_STYLE.get_scf_config(self.resource.dft_style)))
|
|
247
247
|
# do a sorted?
|
|
248
|
-
md_sys_mlmd.
|
|
248
|
+
md_sys_mlmd.extend(out_mlmd_list)
|
|
249
249
|
return md_sys_mlmd
|
|
250
250
|
|
|
251
251
|
def get_aimd_list(self):
|
|
@@ -279,14 +279,23 @@ class Labeling(object):
|
|
|
279
279
|
|
|
280
280
|
# scf files to pwdata format
|
|
281
281
|
scf_configs = self.collect_scf_configs()
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
datasets_path =os.path.join(self.result_dir, datasets_path_name),
|
|
282
|
+
|
|
283
|
+
extract_pwdata(data_list=scf_configs,
|
|
284
|
+
data_format =DFT_STYLE.get_format_by_postfix(os.path.basename(scf_configs[0])),
|
|
285
|
+
datasets_path =self.result_dir,
|
|
287
286
|
train_valid_ratio=self.input_param.train.train_valid_ratio,
|
|
288
287
|
data_shuffle =self.input_param.train.data_shuffle,
|
|
289
288
|
merge_data =True
|
|
290
|
-
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
# for id, scf_md in enumerate(scf_configs):
|
|
292
|
+
# datasets_path_name = os.path.basename(os.path.dirname(os.path.dirname(scf_md[0])))#md.001.sys.001.t.000.p.000
|
|
293
|
+
# extract_pwdata(data_list=scf_md,
|
|
294
|
+
# data_format =DFT_STYLE.get_format_by_postfix(os.path.basename(scf_md[0])),
|
|
295
|
+
# datasets_path =os.path.join(self.result_dir, "{}-{}".format(id, datasets_path_name)),
|
|
296
|
+
# train_valid_ratio=self.input_param.train.train_valid_ratio,
|
|
297
|
+
# data_shuffle =self.input_param.train.data_shuffle,
|
|
298
|
+
# merge_data =True
|
|
299
|
+
# )
|
|
291
300
|
# copy to main dir
|
|
292
301
|
copy_dir(self.result_dir, self.real_result_dir)
|
|
@@ -21,7 +21,7 @@ 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 += "to_pwdata".lower() + "\n
|
|
24
|
+
cmd_info += "to_pwdata".lower() + "\n"
|
|
25
25
|
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
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 'PWact to_pwdata -h'\n\n"
|
|
27
27
|
|
pwact/data_format/configop.py
CHANGED
|
@@ -150,57 +150,32 @@ def extract_pwdata(data_list:list[str],
|
|
|
150
150
|
# if data_format == DFT_STYLE.cp2k:
|
|
151
151
|
# raise Exception("not relized cp2k pwdata convert")
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
if not os.path.isabs(datasets_path):
|
|
154
|
+
# data_name = datasets_path
|
|
155
|
+
datasets_path = os.path.join(os.getcwd(), datasets_path)
|
|
156
|
+
image_data = None
|
|
157
|
+
for data_path in data_list:
|
|
158
|
+
if image_data is not None:
|
|
159
|
+
tmp_config = Config(data_format, data_path)
|
|
160
|
+
# if not isinstance(tmp_config, list):
|
|
161
|
+
# tmp_config = [tmp_config]
|
|
162
|
+
image_data.images.extend(tmp_config.images)
|
|
159
163
|
else:
|
|
160
|
-
|
|
161
|
-
image_data = None
|
|
162
|
-
for data_path in data_list:
|
|
163
|
-
if image_data is not None:
|
|
164
|
-
tmp_config = Config(data_format, data_path)
|
|
165
|
-
# if not isinstance(tmp_config, list):
|
|
166
|
-
# tmp_config = [tmp_config]
|
|
167
|
-
image_data.images.extend(tmp_config.images)
|
|
168
|
-
else:
|
|
169
|
-
image_data = Config(data_format, data_path)
|
|
170
|
-
|
|
171
|
-
if not isinstance(image_data.images, list):
|
|
172
|
-
image_data.images = [image_data.images]
|
|
164
|
+
image_data = Config(data_format, data_path)
|
|
173
165
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
166
|
+
if not isinstance(image_data.images, list):
|
|
167
|
+
image_data.images = [image_data.images]
|
|
168
|
+
|
|
169
|
+
# if not isinstance(image_data, list):
|
|
170
|
+
# image_data = [image_data]
|
|
171
|
+
if interval > 1:
|
|
172
|
+
tmp = []
|
|
173
|
+
for i in range(0, len(image_data.images)):
|
|
174
|
+
if i % interval == 0:
|
|
175
|
+
tmp.append(image_data.images[i])
|
|
176
|
+
image_data.images = tmp
|
|
182
177
|
|
|
183
|
-
|
|
184
|
-
output_path=datasets_path,
|
|
185
|
-
save_format=PWDATA.pwmlff_npy,
|
|
186
|
-
data_name=data_name,
|
|
187
|
-
train_ratio = train_valid_ratio,
|
|
188
|
-
train_data_path="train",
|
|
189
|
-
valid_data_path="valid",
|
|
190
|
-
random=data_shuffle,
|
|
191
|
-
seed = 2024,
|
|
192
|
-
retain_raw = False
|
|
193
|
-
)
|
|
194
|
-
else:
|
|
195
|
-
for data_path in data_list:
|
|
196
|
-
image_data = Config(data_format, data_path)
|
|
197
|
-
if interval > 1:
|
|
198
|
-
tmp = []
|
|
199
|
-
for i in range(0, len(image_data.images)):
|
|
200
|
-
if i % interval == 0:
|
|
201
|
-
tmp.append(image_data.images[i])
|
|
202
|
-
image_data.images = tmp
|
|
203
|
-
image_data.to(
|
|
178
|
+
image_data.to(
|
|
204
179
|
output_path=datasets_path,
|
|
205
180
|
save_format=PWDATA.pwmlff_npy,
|
|
206
181
|
train_ratio = train_valid_ratio,
|
pwact/utils/tmp.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from pwdata import Config
|
|
2
|
+
import os, sys, glob
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
def count_pwdata():
|
|
6
|
+
work_dir = "/data/home/wuxingxing/datas/debugs/dengjiapei/run_iter/iter.0000/label/result_bk"
|
|
7
|
+
dir_list = glob.glob(os.path.join(work_dir, "*"))
|
|
8
|
+
res = []
|
|
9
|
+
for dir in dir_list:
|
|
10
|
+
# train
|
|
11
|
+
train_num = np.load(os.path.join(dir, "train/energies.npy")).shape[0]
|
|
12
|
+
res.append(train_num)
|
|
13
|
+
|
|
14
|
+
if os.path.exists(os.path.join(dir, "valid/energies.npy")):
|
|
15
|
+
test_num = np.load(os.path.join(dir, "valid/energies.npy")).shape[0]
|
|
16
|
+
res.append(test_num)
|
|
17
|
+
print("{} {} {}".format( dir, train_num, test_num))
|
|
18
|
+
else:
|
|
19
|
+
print("{} {}".format(dir, train_num))
|
|
20
|
+
print(np.sum(res))
|
|
21
|
+
|
|
22
|
+
def count_outmlmd():
|
|
23
|
+
work_dir = "/data/home/wuxingxing/datas/debugs/dengjiapei/run_iter/iter.0000/label/scf"
|
|
24
|
+
mlmds = glob.glob(os.path.join(work_dir, "*/*/*/OUT.MLMD"))
|
|
25
|
+
print(len(mlmds))
|
|
26
|
+
|
|
27
|
+
if __name__=="__main__":
|
|
28
|
+
count_pwdata()
|
|
29
|
+
count_outmlmd()
|
|
@@ -12,7 +12,7 @@ pwact/active_learning/init_bulk/init_bulk_run.py,sha256=FG1EAXvuBJ1ERCg2htFVooif
|
|
|
12
12
|
pwact/active_learning/init_bulk/relabel.py,sha256=DJR90gnC_AIWkcbWGcf2FYVCwPU40iP1uB48cTgGn7k,10447
|
|
13
13
|
pwact/active_learning/init_bulk/relax.py,sha256=edyCZLEylUckIwOLBa55agUMo-aedj0dvoyG165YpuE,10450
|
|
14
14
|
pwact/active_learning/label/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
pwact/active_learning/label/labeling.py,sha256=
|
|
15
|
+
pwact/active_learning/label/labeling.py,sha256=tAFyTZjg64cNkG2_3p8qn5pc5F3je64UBgXnJT5PYtU,15687
|
|
16
16
|
pwact/active_learning/slurm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
pwact/active_learning/slurm/slurm.py,sha256=xIDePutt8Q00--61y-RemT4Ky6qL9258kykaxKhIw8w,15637
|
|
18
18
|
pwact/active_learning/slurm/slurm_tool.py,sha256=-4tc5dkpAUP0vmEdmqM8oYLcsUwixa4Z8h5_E9Gevdg,1249
|
|
@@ -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=F6heviYEE0Mm-UITHpei2DhCGuhQMUU0NHxWp_EQAao,3530
|
|
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
|
|
@@ -37,7 +37,7 @@ pwact/active_learning/user_input/train_param/train_param.py,sha256=hsdVojgQZbQGS
|
|
|
37
37
|
pwact/active_learning/user_input/train_param/work_file_param.py,sha256=tmedoLodmkcSK6uRIXTML0BhXFkgE96zPX0_kAXmGoo,11631
|
|
38
38
|
pwact/bin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
pwact/data_format/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
pwact/data_format/configop.py,sha256=
|
|
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
43
|
pwact/utils/file_operation.py,sha256=O26X-qUQuSkVRSVnJx4BPDrPtueVW7sfNvdJ_Y-PN2Q,8554
|
|
@@ -46,15 +46,16 @@ pwact/utils/json_operation.py,sha256=BqBsnIjk1URoMW_s2yu7Gk8IBxlir-oo6ivt8P3RIqg
|
|
|
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=M0YSQ0GRmc5je_Lan6IgU_QIOhTfsqQMjx2PiJhvbM0,999
|
|
49
50
|
pwact/utils/app_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
51
|
pwact/utils/app_lib/common.py,sha256=lQmI-9Qumq62MNjr-eVlLL88ISDHBOb6vAfYYFcDIgM,6040
|
|
51
52
|
pwact/utils/app_lib/cp2k.py,sha256=ljhCCHmZ2kfoXEXn5O7-D56EgTLn2a7H3y_TIkHiasY,13157
|
|
52
53
|
pwact/utils/app_lib/cp2k_dp.py,sha256=VP4gyPGhLcMAqAjrqCQSUiiGlESNlyYz7Gs3Q4QoUHo,6912
|
|
53
54
|
pwact/utils/app_lib/lammps.py,sha256=2oxHJHdDxfDDWWmnjo0gMNwgGvxABwuDgDlb8kbhgfk,8037
|
|
54
55
|
pwact/utils/app_lib/pwmat.py,sha256=PTRPkG_d00ibGhpCe2-4M7MW3dx2ZuAyb9hT2jl_LAs,18047
|
|
55
|
-
pwact-0.1.
|
|
56
|
-
pwact-0.1.
|
|
57
|
-
pwact-0.1.
|
|
58
|
-
pwact-0.1.
|
|
59
|
-
pwact-0.1.
|
|
60
|
-
pwact-0.1.
|
|
56
|
+
pwact-0.1.24.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
57
|
+
pwact-0.1.24.dist-info/METADATA,sha256=5llOmNd82K_g3yifIjuqaFGJde7cXSMyJnsF3Q3eRFg,3659
|
|
58
|
+
pwact-0.1.24.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
59
|
+
pwact-0.1.24.dist-info/entry_points.txt,sha256=p61auAnpbn8E2WjvHNBA7rb9_NRAOCew4zdcCj33cGc,42
|
|
60
|
+
pwact-0.1.24.dist-info/top_level.txt,sha256=fY1_7sH5Lke4dC9L8MbYM4fT5aat5eCkAmpkIzY1SlM,6
|
|
61
|
+
pwact-0.1.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|