pwdata 0.5.3__tar.gz → 0.5.4__tar.gz
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.
- {pwdata-0.5.3 → pwdata-0.5.4}/PKG-INFO +1 -1
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/deepmd.py +6 -5
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/lammpsdata.py +3 -1
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/meta.py +19 -18
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/pwmlff.py +9 -8
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/bamboo2lmdb.py +3 -3
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/PKG-INFO +1 -1
- {pwdata-0.5.3 → pwdata-0.5.4}/setup.py +1 -1
- {pwdata-0.5.3 → pwdata-0.5.4}/LICENSE +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/README.md +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/atomconfig.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/build/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/build/cell.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/build/geometry.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/build/supercells.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/build/write_struc.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/calculators/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/calculators/const.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/calculators/unitconvert_lmps.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/calculators/units.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/check_envs.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/config.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/convert_files.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/cp2kdata.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/datasets_saver.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/dump.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/extendedxyz.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/common/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/common/registry.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/common/typing.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/common/utils.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/_utils.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/ase_datasets.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/base_dataset.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/embeddings/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/embeddings/atomic_radii.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/embeddings/continuous_embeddings.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/embeddings/khot_embeddings.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/embeddings/qmof_khot_embeddings.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/lmdb_database.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/datasets/target_metadata_guesser.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/modules/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/modules/transforms.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/fairchem/preprocessing/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/image.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/lmps.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/main.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/meta_omol.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/molecule.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/movement.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/movement_saver.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/outcar.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/pertub/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/pertub/perturbation.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/pertub/scale.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/poscar.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/extact_outcar_with_ml.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/matpbe2lmdb.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/matrcan2lmdb.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/mdtrajs2config.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/mptraj2lmdb.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/omol25.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test/outcar2mvms.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/test.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/tmp.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/utils/__init__.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/utils/constant.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata/utils/format_change.py +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/SOURCES.txt +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/dependency_links.txt +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/entry_points.txt +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/requires.txt +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/pwdata.egg-info/top_level.txt +0 -0
- {pwdata-0.5.3 → pwdata-0.5.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
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
|
|
@@ -52,15 +52,16 @@ class DPNPY(object):
|
|
|
52
52
|
def load_npy(self, npy_files, atom_nums):
|
|
53
53
|
virial = None
|
|
54
54
|
for npy_file in tqdm(npy_files, desc="Loading data"):
|
|
55
|
-
|
|
55
|
+
npy_file_name = os.path.basename(npy_file)
|
|
56
|
+
if "box" in npy_file_name:
|
|
56
57
|
box = np.load(npy_file).reshape(-1, 3, 3).astype(np.float64)
|
|
57
|
-
elif "coord" in
|
|
58
|
+
elif "coord" in npy_file_name:
|
|
58
59
|
coord = np.load(npy_file).reshape(-1, atom_nums, 3)
|
|
59
|
-
elif "energy" in
|
|
60
|
+
elif "energy" in npy_file_name:
|
|
60
61
|
energy = np.load(npy_file)
|
|
61
|
-
elif "force" in
|
|
62
|
+
elif "force" in npy_file_name:
|
|
62
63
|
force = np.load(npy_file).reshape(-1, atom_nums, 3)
|
|
63
|
-
elif "virial" in
|
|
64
|
+
elif "virial" in npy_file_name:
|
|
64
65
|
virial = np.load(npy_file).reshape(-1, 3, 3)
|
|
65
66
|
|
|
66
67
|
image_nums = len(box)
|
|
@@ -4,7 +4,7 @@ from tqdm import tqdm
|
|
|
4
4
|
from collections import Counter
|
|
5
5
|
from pwdata.image import Image
|
|
6
6
|
from pwdata.calculators.unitconvert_lmps import convert
|
|
7
|
-
from pwdata.calculators.const import ELEMENTMASSTABLE
|
|
7
|
+
from pwdata.calculators.const import ELEMENTMASSTABLE, ELEMENTTABLE
|
|
8
8
|
from pwdata.utils.format_change import to_numpy_array, to_integer, to_float
|
|
9
9
|
class LMP(object):
|
|
10
10
|
def __init__(self, lmp_file, atom_names: list[str] = None, units: str = 'metal', style: str = 'atomic', sort_by_id: bool = True) -> None:
|
|
@@ -323,6 +323,8 @@ class LMP(object):
|
|
|
323
323
|
ids[ind] = id
|
|
324
324
|
# by type
|
|
325
325
|
types[ind] = type
|
|
326
|
+
if self.atom_names is not None:
|
|
327
|
+
atom_types_image[ind] = ELEMENTTABLE[self.atom_names[type - 1]]
|
|
326
328
|
if len(atom_names) == 0:
|
|
327
329
|
atom_types_image[ind] = type
|
|
328
330
|
else:
|
|
@@ -52,24 +52,25 @@ class META(object):
|
|
|
52
52
|
cpu_nums = min(cpu_nums, multiprocessing.cpu_count())
|
|
53
53
|
if isinstance(input, str):
|
|
54
54
|
input = [input]
|
|
55
|
+
atom_lists = []
|
|
55
56
|
# single cpu debug
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
if cpu_nums == 1:
|
|
58
|
+
for i, _ in enumerate(input):
|
|
59
|
+
_atom_lists = load_and_query_db(_, atom_types, query, filter_with_elements)
|
|
60
|
+
# for _ in _atom_lists:
|
|
61
|
+
# print(_.formula)
|
|
62
|
+
atom_lists.append(_atom_lists)
|
|
63
|
+
else:
|
|
64
|
+
# 使用多进程并行加载和查询数据库
|
|
65
|
+
with ProcessPoolExecutor(max_workers=cpu_nums) as executor:
|
|
66
|
+
futures = []
|
|
67
|
+
for db_address in input:
|
|
68
|
+
futures.append(executor.submit(load_and_query_db, db_address, atom_types, query, filter_with_elements))
|
|
69
|
+
|
|
70
|
+
# 收集查询结果
|
|
71
|
+
atom_lists = []
|
|
72
|
+
for future in as_completed(futures):
|
|
73
|
+
atom_lists.append(future.result())
|
|
73
74
|
|
|
74
75
|
# 处理所有结果
|
|
75
76
|
for atom_list in atom_lists:
|
|
@@ -123,7 +124,6 @@ def to_image(Atoms):
|
|
|
123
124
|
image.cartesian = True
|
|
124
125
|
image.force = to_numpy_array(Atoms.forces)
|
|
125
126
|
image.Ep = to_float(Atoms.energy)
|
|
126
|
-
|
|
127
127
|
# 计算 Atomic-Energy
|
|
128
128
|
# atomic_energy, _, _, _ = np.linalg.lstsq([image.atom_type_num], np.array([image.Ep]), rcond=1e-3)
|
|
129
129
|
# atomic_energy = np.repeat(atomic_energy, image.atom_type_num)
|
|
@@ -137,5 +137,6 @@ def to_image(Atoms):
|
|
|
137
137
|
[virial[5], virial[1], virial[3]],
|
|
138
138
|
[virial[4], virial[3], virial[2]]
|
|
139
139
|
])
|
|
140
|
+
# print(image.virial)
|
|
140
141
|
image.format = 'metadata'
|
|
141
142
|
return image
|
|
@@ -38,21 +38,22 @@ class PWNPY(object):
|
|
|
38
38
|
virial = None
|
|
39
39
|
coord = None
|
|
40
40
|
for npy_file in npy_files:
|
|
41
|
-
|
|
41
|
+
npy_file_name = os.path.basename(npy_file)
|
|
42
|
+
if "atom_type.npy" in npy_file_name:
|
|
42
43
|
atom_type = to_numpy_array(np.load(npy_file).squeeze())
|
|
43
|
-
elif "ei" in
|
|
44
|
+
elif "ei.npy" in npy_file_name:
|
|
44
45
|
atomic_energy = np.load(npy_file) if atomic_energy is None else np.concatenate((atomic_energy, np.load(npy_file)))
|
|
45
|
-
elif "energies" in
|
|
46
|
+
elif "energies.npy" in npy_file_name:
|
|
46
47
|
Ep = np.load(npy_file) if Ep is None else np.concatenate((Ep, np.load(npy_file)))
|
|
47
|
-
elif "forces" in
|
|
48
|
+
elif "forces.npy" in npy_file_name:
|
|
48
49
|
force = np.load(npy_file) if force is None else np.concatenate((force, np.load(npy_file)))
|
|
49
|
-
elif "image_type" in
|
|
50
|
+
elif "image_type.npy" in npy_file_name:
|
|
50
51
|
atom_types_image = np.load(npy_file).squeeze()
|
|
51
|
-
elif "lattice" in
|
|
52
|
+
elif "lattice.npy" in npy_file_name:
|
|
52
53
|
lattice = np.load(npy_file) if lattice is None else np.concatenate((lattice, np.load(npy_file)))
|
|
53
|
-
elif "virials" in
|
|
54
|
+
elif "virials.npy" in npy_file_name:
|
|
54
55
|
virial = np.load(npy_file) if virial is None else np.concatenate((virial, np.load(npy_file)))
|
|
55
|
-
elif "position" in
|
|
56
|
+
elif "position.npy" in npy_file_name:
|
|
56
57
|
coord = np.load(npy_file) if coord is None else np.concatenate((coord, np.load(npy_file)))
|
|
57
58
|
|
|
58
59
|
image_nums = len(Ep)
|
|
@@ -122,9 +122,9 @@ def cvtbamboo(pt_dir, save_dir, prefix):
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
if __name__=="__main__":
|
|
125
|
-
pt_dir="/share/public/PWMLFF_test_data/bamboo/
|
|
126
|
-
save_dir="/share/public/PWMLFF_test_data/bamboo/
|
|
125
|
+
pt_dir="/share/public/PWMLFF_test_data/bamboo/mini"
|
|
126
|
+
save_dir="/share/public/PWMLFF_test_data/bamboo/mini_aselmdb"
|
|
127
127
|
if not os.path.exists(save_dir):
|
|
128
128
|
os.makedirs(save_dir)
|
|
129
|
-
prefix = "bamboo-
|
|
129
|
+
prefix = "bamboo-mini"
|
|
130
130
|
cvtbamboo(pt_dir, save_dir, prefix)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
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
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="pwdata",
|
|
8
|
-
version="0.5.
|
|
8
|
+
version="0.5.4",
|
|
9
9
|
author="LonxunQuantum",
|
|
10
10
|
author_email="lonxun@pwmat.com",
|
|
11
11
|
description="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.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|