pwdata 0.5.5.dev0__py3-none-any.whl → 0.5.6.dev0__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.
Potentially problematic release.
This version of pwdata might be problematic. Click here for more details.
- pwdata/atomconfig.py +5 -4
- pwdata/check_envs.py +1 -1
- pwdata/config.py +1 -1
- pwdata/convert_files.py +8 -8
- pwdata/extendedxyz.py +2 -1
- pwdata/main.py +4 -1
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/METADATA +1 -1
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/RECORD +12 -12
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/LICENSE +0 -0
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/WHEEL +0 -0
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/entry_points.txt +0 -0
- {pwdata-0.5.5.dev0.dist-info → pwdata-0.5.6.dev0.dist-info}/top_level.txt +0 -0
pwdata/atomconfig.py
CHANGED
|
@@ -2,6 +2,7 @@ import re
|
|
|
2
2
|
from tqdm import tqdm
|
|
3
3
|
from collections import Counter
|
|
4
4
|
from pwdata.image import Image
|
|
5
|
+
from pwdata.utils.format_change import to_numpy_array, to_integer, to_float
|
|
5
6
|
|
|
6
7
|
class CONFIG(object):
|
|
7
8
|
def __init__(self, config_file, pbc = None) -> None:
|
|
@@ -29,10 +30,10 @@ class CONFIG(object):
|
|
|
29
30
|
image.atom_nums = atom_nums
|
|
30
31
|
elif "position" in ii.lower():
|
|
31
32
|
position = self.parse_position(config_contents[idx+1:idx+image.atom_nums+1])
|
|
32
|
-
image.position = position["position"]
|
|
33
|
-
image.atom_type = position["atom_type"]
|
|
34
|
-
image.atom_type_num = position["atom_type_num"]
|
|
35
|
-
image.atom_types_image = position["atom_types_image"]
|
|
33
|
+
image.position = to_numpy_array(position["position"])
|
|
34
|
+
image.atom_type = to_numpy_array(position["atom_type"])
|
|
35
|
+
image.atom_type_num = to_numpy_array(position["atom_type_num"])
|
|
36
|
+
image.atom_types_image = to_numpy_array(position["atom_types_image"])
|
|
36
37
|
image.image_nums = len(self.image_list)
|
|
37
38
|
print("Load data %s successfully!" % config_file)
|
|
38
39
|
|
pwdata/check_envs.py
CHANGED
|
@@ -15,7 +15,7 @@ def cmd_infos():
|
|
|
15
15
|
info += "\tpwdata super_cell -i input_file -f input_file_format -n output_format_name -o output_format\n"
|
|
16
16
|
info += "\tYou can also use 'pwdata super_cell -h' to obtain a more detailed parameter list\n\n"
|
|
17
17
|
|
|
18
|
-
info += "surf or surface
|
|
18
|
+
info += "surf or surface: Under Development (2025.10.31)\n"
|
|
19
19
|
info += "\n"
|
|
20
20
|
|
|
21
21
|
info += "perturb:\n"
|
pwdata/config.py
CHANGED
|
@@ -185,7 +185,7 @@ class Config(object):
|
|
|
185
185
|
elif format.lower() == "vasp/outcar":
|
|
186
186
|
image = OUTCAR(data_path).image_list[index]
|
|
187
187
|
elif format.lower() == "extxyz":
|
|
188
|
-
image = EXTXYZ(data_path
|
|
188
|
+
image = EXTXYZ(data_path).image_list[index]
|
|
189
189
|
elif format.lower() == "vasp/xml":
|
|
190
190
|
image = None
|
|
191
191
|
elif format.lower() == 'cp2k/md':
|
pwdata/convert_files.py
CHANGED
|
@@ -208,7 +208,7 @@ def do_convert_images(
|
|
|
208
208
|
merge:bool=True
|
|
209
209
|
):
|
|
210
210
|
data_files = search_images(input, input_format)
|
|
211
|
-
image_data = load_files(data_files, input_format, atom_types=atom_types, query=query, cpu_nums=cpu_nums)
|
|
211
|
+
image_data = load_files(data_files, input_format, atom_types=atom_types, query=query, cpu_nums=cpu_nums, index=gap)
|
|
212
212
|
save_images(savepath, image_data, output_format, data_shuffle, merge)
|
|
213
213
|
|
|
214
214
|
def do_count_images(
|
|
@@ -353,7 +353,7 @@ def search_by_format(workDir, format):
|
|
|
353
353
|
return data_path[format]
|
|
354
354
|
|
|
355
355
|
|
|
356
|
-
def load_files(input_dict:dict, input_format:str=None, atom_types:list[str]=None, query:str=None, cpu_nums=None):
|
|
356
|
+
def load_files(input_dict:dict, input_format:str=None, atom_types:list[str]=None, query:str=None, cpu_nums=None, index=":"):
|
|
357
357
|
image_data = None
|
|
358
358
|
if input_format is not None:
|
|
359
359
|
if input_format == FORMAT.meta:
|
|
@@ -362,31 +362,31 @@ def load_files(input_dict:dict, input_format:str=None, atom_types:list[str]=None
|
|
|
362
362
|
metadatas = [input_dict[FORMAT.meta][i:i + chunk_size] for i in range(0, lmdb_nums, chunk_size)]
|
|
363
363
|
for idx, metapaths in enumerate(tqdm(metadatas, total=lmdb_nums // chunk_size)):
|
|
364
364
|
if image_data is None:
|
|
365
|
-
image_data = Config(input_format, metapaths, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
365
|
+
image_data = Config(input_format, metapaths, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
366
366
|
if not isinstance(image_data.images, list): # for the first pwmlff/npy dir only has one picture
|
|
367
367
|
image_data.images = [image_data.images]
|
|
368
368
|
else:
|
|
369
|
-
tmp_image_data = Config(input_format, metapaths, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
369
|
+
tmp_image_data = Config(input_format, metapaths, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
370
370
|
image_data.images.extend(tmp_image_data.images)
|
|
371
371
|
# print("There are a total of {} aselmdb, and the current progress has been loaded {} %".format(lmdb_nums, np.round(idx*chunk_size/lmdb_nums, 2)))
|
|
372
372
|
else:
|
|
373
373
|
if len(input_dict[FORMAT.traj]) > 0:# the input is traj files
|
|
374
374
|
for data_path in tqdm(input_dict[FORMAT.traj], total=len(input_dict[FORMAT.traj])):
|
|
375
375
|
if image_data is None:
|
|
376
|
-
image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
376
|
+
image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
377
377
|
if not isinstance(image_data.images, list): # for the first pwmlff/npy dir only has one picture
|
|
378
378
|
image_data.images = [image_data.images]
|
|
379
379
|
else:
|
|
380
|
-
tmp_image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
380
|
+
tmp_image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
381
381
|
image_data.images.extend(tmp_image_data.images)
|
|
382
382
|
else:
|
|
383
383
|
for data_path in tqdm(input_dict[input_format], total=len(input_dict[input_format])):
|
|
384
384
|
if image_data is None:
|
|
385
|
-
image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
385
|
+
image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
386
386
|
if not isinstance(image_data.images, list): # for the first pwmlff/npy dir only has one picture
|
|
387
387
|
image_data.images = [image_data.images]
|
|
388
388
|
else:
|
|
389
|
-
tmp_image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums)
|
|
389
|
+
tmp_image_data = Config(input_format, data_path, atom_names=atom_types, query=query, cpu_nums=cpu_nums, index=index)
|
|
390
390
|
image_data.images.extend(tmp_image_data.images)
|
|
391
391
|
return image_data
|
|
392
392
|
|
pwdata/extendedxyz.py
CHANGED
|
@@ -8,7 +8,8 @@ from math import ceil
|
|
|
8
8
|
from collections import Counter
|
|
9
9
|
|
|
10
10
|
class EXTXYZ(object):
|
|
11
|
-
|
|
11
|
+
# index is not used in this reading
|
|
12
|
+
def __init__(self, xyz_file, index=None) -> None:
|
|
12
13
|
self.image_list:list[Image] = []
|
|
13
14
|
self.number_pattern = re.compile(r"[-+]?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?")
|
|
14
15
|
self.load_xyz_file(xyz_file, index)
|
pwdata/main.py
CHANGED
|
@@ -367,7 +367,10 @@ def run_convert_configs(cmd_list:list[str]):
|
|
|
367
367
|
else:
|
|
368
368
|
assert os.path.exists(_input)
|
|
369
369
|
input_list.append(_input)
|
|
370
|
-
|
|
370
|
+
if not isinstance(args.gap, int) or args.gap <= 0:
|
|
371
|
+
raise Exception("Error! The input '-g' or '--gap' must be a positive integer!")
|
|
372
|
+
else:
|
|
373
|
+
args.gap = f"::{args.gap}"
|
|
371
374
|
# FORMAT.check_format(args.input_format, FORMAT.support_images_format)
|
|
372
375
|
FORMAT.check_format(args.output_format, [FORMAT.pwmlff_npy, FORMAT.extxyz])
|
|
373
376
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6.dev0
|
|
4
4
|
Summary: pwdata is a data pre-processing tool for MatPL, which can be used to extract features and labels. It also provides convenient interfaces for data conversion between different software.
|
|
5
5
|
Home-page: https://github.com/LonxunQuantum/pwdata
|
|
6
6
|
Author: LonxunQuantum
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
pwdata/__init__.py,sha256=Kgr0CuCVCWRuAz5neO_bygn4JVFUZuUng8Nz4MMVVOo,426
|
|
2
|
-
pwdata/atomconfig.py,sha256=
|
|
3
|
-
pwdata/check_envs.py,sha256=
|
|
4
|
-
pwdata/config.py,sha256=
|
|
5
|
-
pwdata/convert_files.py,sha256=
|
|
2
|
+
pwdata/atomconfig.py,sha256=SuGXzaul9SSQS7luXuN3vhAMEeEpm-HT9-XHdH1IDwE,2797
|
|
3
|
+
pwdata/check_envs.py,sha256=qlCglZjtwTZBQXy9i7A-7QKS0M_HOrV0dcOCBiAuJxw,4693
|
|
4
|
+
pwdata/config.py,sha256=QIo2Kb0rV3zf6qjPPV8ICp3e5KEkm2zm-GtZUGVAsjU,16039
|
|
5
|
+
pwdata/convert_files.py,sha256=ew5gGYFP95q2IHwEDY4H1_-hxApGdYPMBdjJuX9PLbY,21707
|
|
6
6
|
pwdata/cp2kdata.py,sha256=Obs4ryVZEkDjhmuqA4l4Tf6PQUycPDquAC4FNWHVro4,14669
|
|
7
7
|
pwdata/datasets_saver.py,sha256=TwIrA1slKiibplkMGjkSeAkmbFl8Y-bhf-n11rR9Sj8,5947
|
|
8
8
|
pwdata/deepmd.py,sha256=1nwYkbLjU5xfSF85ZrsxvMSzjcu1yiVbnZZdS1jP5fg,6403
|
|
9
9
|
pwdata/dump.py,sha256=I8F_thxGYpdXkcKAFSwQ91gaRhft_SrCr4YfiLH-Fo0,9569
|
|
10
|
-
pwdata/extendedxyz.py,sha256
|
|
10
|
+
pwdata/extendedxyz.py,sha256=-2bBuF90E6F0OeUaaUz5h5LV5v_7P04RWY4a0fgAfPo,8020
|
|
11
11
|
pwdata/image.py,sha256=8eQ_xDYH2XGgkCT9KkzZ5BG1vZk1qPkHjSf1fvX6qlw,13334
|
|
12
12
|
pwdata/lammpsdata.py,sha256=6oO6TUIKrW3Nk1VkhJDYBU1Y0bmQUREsX44uEG7iB0k,14305
|
|
13
13
|
pwdata/lmps.py,sha256=xAkarI7XFv1On1Oh2g8PsTlUROcfTnhPcID0wV5nPNY,1661
|
|
14
|
-
pwdata/main.py,sha256=
|
|
14
|
+
pwdata/main.py,sha256=bARRpFMEVGaHx-bDB4s6b3R3J2sw47lB1u7SNohTVY4,34943
|
|
15
15
|
pwdata/meta.py,sha256=DdMkyCRob9TdmksZ5UJp_xj-R2rRKCOpcWkXh53RiFI,6062
|
|
16
16
|
pwdata/meta_omol.py,sha256=NywqGjCcwCxr3YX4DummRv84um9vWZACn_ldfzWo94k,7177
|
|
17
17
|
pwdata/molecule.py,sha256=pZcJI54WVwOGFgmbLb6UYwVmk25ldTppmtW5oG2cEwc,5732
|
|
@@ -68,9 +68,9 @@ pwdata/test/surf_test.py,sha256=3iawNNnF_474DBOhvo4Ua0O1lMZyt4cQlChSFM8xjkY,914
|
|
|
68
68
|
pwdata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
69
|
pwdata/utils/constant.py,sha256=pwDpfp_nvJd5tCpjycsF4B4dQZYiBQm5kZNQoPB5FRk,7387
|
|
70
70
|
pwdata/utils/format_change.py,sha256=ucPzy7Uaa7k8blXVrut4dpQANk7mKtbgO6D_YFqd2HE,1130
|
|
71
|
-
pwdata-0.5.
|
|
72
|
-
pwdata-0.5.
|
|
73
|
-
pwdata-0.5.
|
|
74
|
-
pwdata-0.5.
|
|
75
|
-
pwdata-0.5.
|
|
76
|
-
pwdata-0.5.
|
|
71
|
+
pwdata-0.5.6.dev0.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
|
72
|
+
pwdata-0.5.6.dev0.dist-info/METADATA,sha256=WCW3MOJJlu6eie0zb6uvTnmqHQ8o8BcgxAHbL8X6gn8,888
|
|
73
|
+
pwdata-0.5.6.dev0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
74
|
+
pwdata-0.5.6.dev0.dist-info/entry_points.txt,sha256=XbNyK3OjlyNr9XB_PkdTtcCaqgqpYdoBixa9wRpg-y0,44
|
|
75
|
+
pwdata-0.5.6.dev0.dist-info/top_level.txt,sha256=H7nBIvckt_L9t_ADtnd7uSiGXXMu6DyqMQxY6zprRBY,7
|
|
76
|
+
pwdata-0.5.6.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|