pwdata 0.4.10__tar.gz → 0.5.0__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.
Potentially problematic release.
This version of pwdata might be problematic. Click here for more details.
- {pwdata-0.4.10 → pwdata-0.5.0}/PKG-INFO +1 -1
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/check_envs.py +14 -1
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/convert_files.py +1 -1
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/extendedxyz.py +2 -2
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/main.py +4 -2
- pwdata-0.5.0/pwdata/test/matpbe2lmdb.py +61 -0
- pwdata-0.5.0/pwdata/test/matrcan2lmdb.py +70 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/test/mptraj2lmdb.py +9 -28
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/PKG-INFO +1 -1
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/SOURCES.txt +2 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/setup.py +1 -1
- {pwdata-0.4.10 → pwdata-0.5.0}/LICENSE +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/README.md +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/atomconfig.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/build/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/build/cell.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/build/geometry.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/build/supercells.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/build/write_struc.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/calculators/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/calculators/const.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/calculators/unitconvert_lmps.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/calculators/units.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/config.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/cp2kdata.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/datasets_saver.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/deepmd.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/dump.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/common/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/common/registry.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/common/typing.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/common/utils.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/_utils.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/ase_datasets.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/base_dataset.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/embeddings/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/embeddings/atomic_radii.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/embeddings/continuous_embeddings.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/embeddings/khot_embeddings.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/embeddings/qmof_khot_embeddings.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/lmdb_database.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/datasets/target_metadata_guesser.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/modules/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/modules/transforms.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/fairchem/preprocessing/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/image.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/lammpsdata.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/lmps.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/meta.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/movement.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/movement_saver.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/outcar.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/pertub/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/pertub/perturbation.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/pertub/scale.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/poscar.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/pwmlff.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/test/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/test/mdtrajs2config.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/test.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/utils/__init__.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/utils/constant.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata/utils/format_change.py +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/dependency_links.txt +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/entry_points.txt +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/requires.txt +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/pwdata.egg-info/top_level.txt +0 -0
- {pwdata-0.4.10 → pwdata-0.5.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: pwdata is a data pre-processing tool for PWMLFF, 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,4 +52,17 @@ def cmd_infos():
|
|
|
52
52
|
info += "| \* (meta aselmdb) | \*.aselmdb | True | True | 'meta' |\n"
|
|
53
53
|
info += "__________________________________________________________________________________________|\n\n"
|
|
54
54
|
|
|
55
|
-
print(info)
|
|
55
|
+
print(info)
|
|
56
|
+
|
|
57
|
+
def comm_info():
|
|
58
|
+
print("\n" + "=" * 50)
|
|
59
|
+
print(" PWDATA Basic Information")
|
|
60
|
+
print("=" * 50)
|
|
61
|
+
print("Version: 0.5.0")
|
|
62
|
+
print("support pwact: >= 0.2.0")
|
|
63
|
+
print("support MatPL: >= 2025.3")
|
|
64
|
+
print("Contact: support@pwmat.com")
|
|
65
|
+
print("Citation: https://github.com/LonxunQuantum/MatPL")
|
|
66
|
+
print("Manual online: http://doc.lonxun.com/PWMLFF/")
|
|
67
|
+
print("=" * 50)
|
|
68
|
+
print("\n\n")
|
|
@@ -24,7 +24,7 @@ def do_convert_config(input_file:str,
|
|
|
24
24
|
if output_format is None:
|
|
25
25
|
output_format = FORMAT.pwmat_config if image.format == FORMAT.cp2k_scf else image.format
|
|
26
26
|
if savename is None:
|
|
27
|
-
savename = FORMAT.get_filename_by_format(
|
|
27
|
+
savename = FORMAT.get_filename_by_format(output_format)
|
|
28
28
|
|
|
29
29
|
image.to(data_path = os.path.dirname(os.path.abspath(savename)),
|
|
30
30
|
data_name = os.path.basename(savename),
|
|
@@ -53,12 +53,12 @@ def get_xyz_content(image_data:Image):
|
|
|
53
53
|
image_data._set_cartesian()
|
|
54
54
|
xyz_content +="%d\n" % image_data.atom_nums
|
|
55
55
|
# data_name.write("Iteration: %s\n" % image_data.iteration)
|
|
56
|
-
output_head = 'Lattice="%.
|
|
56
|
+
output_head = 'Lattice="%.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f" Properties=species:S:1:pos:R:3:force:R:3 pbc="T T T" energy={} '.format(image_data.Ep)
|
|
57
57
|
output_extended = (image_data.lattice[0][0], image_data.lattice[0][1], image_data.lattice[0][2],
|
|
58
58
|
image_data.lattice[1][0], image_data.lattice[1][1], image_data.lattice[1][2],
|
|
59
59
|
image_data.lattice[2][0], image_data.lattice[2][1], image_data.lattice[2][2])
|
|
60
60
|
if image_data.virial is not None and len(image_data.virial) > 0:
|
|
61
|
-
output_head += 'virial="%.
|
|
61
|
+
output_head += 'virial="%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f"'
|
|
62
62
|
virial = image_data.get_virial()
|
|
63
63
|
output_extended += (virial[0][0], virial[0][1], virial[0][2],
|
|
64
64
|
virial[1][0], virial[1][1], virial[1][2],
|
|
@@ -24,7 +24,7 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
|
24
24
|
import argparse
|
|
25
25
|
from pwdata.convert_files import do_scale_cell, do_super_cell, do_perturb, do_convert_config, do_convert_images, do_count_images
|
|
26
26
|
from pwdata.utils.constant import FORMAT, get_atomic_name_from_number
|
|
27
|
-
from pwdata.check_envs import print_cmd
|
|
27
|
+
from pwdata.check_envs import print_cmd, comm_info
|
|
28
28
|
|
|
29
29
|
# from pwdata.open_data.meta_data import get_meta_data
|
|
30
30
|
|
|
@@ -49,6 +49,7 @@ def string2index(string: str) -> Union[int, slice, str]:
|
|
|
49
49
|
pwdata convert -i dirs -f extxyz -s dir
|
|
50
50
|
"""
|
|
51
51
|
def main(cmd_list:list=None):
|
|
52
|
+
|
|
52
53
|
if cmd_list is None:
|
|
53
54
|
cmd_list = sys.argv
|
|
54
55
|
if len(cmd_list) == 2 and '.json' in cmd_list[1].lower():
|
|
@@ -219,7 +220,7 @@ def run_convert_config(cmd_list:list[str]):
|
|
|
219
220
|
# else:
|
|
220
221
|
# FORMAT.check_format(args.output_format, [FORMAT.pwmat_config, FORMAT.vasp_poscar, FORMAT.lammps_lmp])
|
|
221
222
|
do_convert_config(args.input, args.input_format, args.atom_types, args.savename, args.output_format, args.cartesian is False)
|
|
222
|
-
print("
|
|
223
|
+
print("convert the config to {} format done!".format(args.output_format))
|
|
223
224
|
|
|
224
225
|
def run_convert_configs(cmd_list:list[str]):
|
|
225
226
|
parser = argparse.ArgumentParser(description='This command is used for transferring structural files between different apps. For extxyz format, all configs will save to one file, \nFor pwmlff/npy, configs with same atom types and atom nums in each type will save to one dir.\n')
|
|
@@ -290,4 +291,5 @@ def count_configs(cmd_list:list[str]):
|
|
|
290
291
|
do_count_images(input_list, args.input_format, atom_types, args.query, args.cpu_nums)
|
|
291
292
|
|
|
292
293
|
if __name__ == "__main__":
|
|
294
|
+
comm_info()
|
|
293
295
|
main()
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'''
|
|
2
|
+
description:
|
|
3
|
+
Convert MPtraj JSON file to aselmdb format
|
|
4
|
+
'''
|
|
5
|
+
import os
|
|
6
|
+
import json
|
|
7
|
+
from pwdata.fairchem.datasets.ase_datasets import LMDBDatabase
|
|
8
|
+
from ase import Atoms
|
|
9
|
+
from ase.db.row import AtomsRow
|
|
10
|
+
from pwdata.utils.constant import get_atomic_number_from_name
|
|
11
|
+
from tqdm import tqdm
|
|
12
|
+
import numpy as np
|
|
13
|
+
|
|
14
|
+
def MPjson2lmdb():
|
|
15
|
+
mat_file = "/data/home/wuxingxing/datas/PWMLFF_library_data/mat/MatPES-PBE-2025.1.json"
|
|
16
|
+
save_file = "/data/home/wuxingxing/datas/PWMLFF_library_data/mat/MatPES-PBE-2025.1.aselmdb"
|
|
17
|
+
matjson = json.load(open(mat_file))
|
|
18
|
+
db = LMDBDatabase(filename=save_file, readonly=False)
|
|
19
|
+
for i, v in tqdm(enumerate(matjson), total=len(matjson.keys())):
|
|
20
|
+
_atomrow, data = cvt_matdict_2_atomrow(v)
|
|
21
|
+
data["idx"] = "{} MatPES-PBE-2025.1.json".format(i)
|
|
22
|
+
db._write(_atomrow, key_value_pairs={}, data=data)
|
|
23
|
+
db.close()
|
|
24
|
+
|
|
25
|
+
def cvt_matdict_2_atomrow(config:dict):
|
|
26
|
+
cell = read_from_dict('matrix', config['structure']['lattice'], require=True)
|
|
27
|
+
atom_type_list = get_atomic_number_from_name([_['label'] for _ in config['structure']['sites']])
|
|
28
|
+
position = [_['xyz'] for _ in config['structure']['sites']]
|
|
29
|
+
magmom = [_['properties']['magmom'] for _ in config['structure']['sites']]
|
|
30
|
+
# magmom = read_from_dict('magmom', config, require=True)
|
|
31
|
+
atom = Atoms(positions=position,
|
|
32
|
+
numbers=atom_type_list,
|
|
33
|
+
magmoms=magmom,
|
|
34
|
+
cell=cell)
|
|
35
|
+
|
|
36
|
+
atom_rows = AtomsRow(atom)
|
|
37
|
+
atom_rows.pbc = np.ones(3, bool)
|
|
38
|
+
# read stress -> xx, yy, zz, yz, xz, xy
|
|
39
|
+
stress = read_from_dict('stress', config, require=True)
|
|
40
|
+
atom_rows.stress = [stress[0],stress[1],stress[2],stress[3],stress[4],stress[5]]
|
|
41
|
+
force = read_from_dict('forces', config, require=True) #mat is s
|
|
42
|
+
energy = read_from_dict('energy', config, require=True)
|
|
43
|
+
atom_rows.__setattr__('force', force)
|
|
44
|
+
atom_rows.__setattr__('forces', force)
|
|
45
|
+
atom_rows.__setattr__('energy', energy)
|
|
46
|
+
data = {}
|
|
47
|
+
return atom_rows, data
|
|
48
|
+
|
|
49
|
+
def read_from_dict(key:str, config:dict, default=None, require=False):
|
|
50
|
+
if key in config:
|
|
51
|
+
return config[key]
|
|
52
|
+
else:
|
|
53
|
+
if require:
|
|
54
|
+
raise ValueError("key {} not found in config".format(key))
|
|
55
|
+
else:
|
|
56
|
+
return default
|
|
57
|
+
|
|
58
|
+
if __name__=="__main__":
|
|
59
|
+
MPjson2lmdb()
|
|
60
|
+
|
|
61
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
|
|
3
|
+
Date: 2025-03-16 11:22:36
|
|
4
|
+
LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
|
|
5
|
+
LastEditTime: 2025-03-16 11:26:59
|
|
6
|
+
FilePath: /pwdata_dev/pwdata/test/matrcan2lmdb.py
|
|
7
|
+
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
'''
|
|
9
|
+
'''
|
|
10
|
+
description:
|
|
11
|
+
Convert MPtraj JSON file to aselmdb format
|
|
12
|
+
'''
|
|
13
|
+
import os
|
|
14
|
+
import json
|
|
15
|
+
from pwdata.fairchem.datasets.ase_datasets import LMDBDatabase
|
|
16
|
+
from ase import Atoms
|
|
17
|
+
from ase.db.row import AtomsRow
|
|
18
|
+
from pwdata.utils.constant import get_atomic_number_from_name
|
|
19
|
+
from tqdm import tqdm
|
|
20
|
+
import numpy as np
|
|
21
|
+
|
|
22
|
+
def MPjson2lmdb():
|
|
23
|
+
mat_file = "/data/home/wuxingxing/datas/PWMLFF_library_data/matpes-rscan/MatPES-R2SCAN-2025.1.json"
|
|
24
|
+
save_file = "/data/home/wuxingxing/datas/PWMLFF_library_data/matpes-rscan/MatPES-R2SCAN-2025.1.aselmdb"
|
|
25
|
+
matjson = json.load(open(mat_file))
|
|
26
|
+
db = LMDBDatabase(filename=save_file, readonly=False)
|
|
27
|
+
for i, val in tqdm(enumerate(matjson), total=len(matjson), desc="mat.json to aselmdb"):
|
|
28
|
+
_atomrow, data = cvt_matdict_2_atomrow(val)
|
|
29
|
+
data["idx"] = "{} MatPES-R2SCAN-2025.1.json".format(i)
|
|
30
|
+
db._write(_atomrow, key_value_pairs={}, data=data)
|
|
31
|
+
db.close()
|
|
32
|
+
|
|
33
|
+
def cvt_matdict_2_atomrow(config:dict):
|
|
34
|
+
cell = read_from_dict('matrix', config['structure']['lattice'], require=True)
|
|
35
|
+
atom_type_list = get_atomic_number_from_name([_['label'] for _ in config['structure']['sites']])
|
|
36
|
+
position = [_['xyz'] for _ in config['structure']['sites']]
|
|
37
|
+
magmom = [_['properties']['magmom'] for _ in config['structure']['sites']]
|
|
38
|
+
# magmom = read_from_dict('magmom', config, require=True)
|
|
39
|
+
atom = Atoms(positions=position,
|
|
40
|
+
numbers=atom_type_list,
|
|
41
|
+
magmoms=magmom,
|
|
42
|
+
cell=cell)
|
|
43
|
+
|
|
44
|
+
atom_rows = AtomsRow(atom)
|
|
45
|
+
atom_rows.pbc = np.ones(3, bool)
|
|
46
|
+
# read stress -> xx, yy, zz, yz, xz, xy
|
|
47
|
+
virial = read_from_dict('stress', config, require=True) # this is vrial and the order is xx, yy, zz, yz, xz, xy
|
|
48
|
+
stress = -np.array(virial) / config['volume']
|
|
49
|
+
atom_rows.stress = [stress[0],stress[1],stress[2],stress[3],stress[4],stress[5]]
|
|
50
|
+
force = read_from_dict('forces', config, require=True) #mat is s
|
|
51
|
+
energy = read_from_dict('energy', config, require=True)
|
|
52
|
+
atom_rows.__setattr__('force', force)
|
|
53
|
+
atom_rows.__setattr__('forces', force)
|
|
54
|
+
atom_rows.__setattr__('energy', energy)
|
|
55
|
+
data = {}
|
|
56
|
+
return atom_rows, data
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def read_from_dict(key:str, config:dict, default=None, require=False):
|
|
60
|
+
if key in config:
|
|
61
|
+
return config[key]
|
|
62
|
+
else:
|
|
63
|
+
if require:
|
|
64
|
+
raise ValueError("key {} not found in config".format(key))
|
|
65
|
+
else:
|
|
66
|
+
return default
|
|
67
|
+
if __name__=="__main__":
|
|
68
|
+
MPjson2lmdb()
|
|
69
|
+
|
|
70
|
+
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
description:
|
|
3
3
|
Convert MPtraj JSON file to aselmdb format
|
|
4
4
|
'''
|
|
5
|
-
|
|
5
|
+
import os
|
|
6
6
|
import json
|
|
7
7
|
from pwdata.fairchem.datasets.ase_datasets import LMDBDatabase
|
|
8
8
|
from ase import Atoms
|
|
@@ -12,17 +12,18 @@ from tqdm import tqdm
|
|
|
12
12
|
import numpy as np
|
|
13
13
|
|
|
14
14
|
def MPjson2lmdb():
|
|
15
|
-
mp_file = "/data/home/wuxingxing/codespace/
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
mp_file = "/data/home/wuxingxing/codespace/pwdata_dev/examples/mp_data/mptest.json"
|
|
16
|
+
# mpjson = "/share/public/PWMLFF_test_data/eqv2-models/datasets/MPtrj/MPtrj_2022.9_full.json" 12G too big
|
|
17
|
+
save_file = "/data/home/wuxingxing/codespace/pwdata_dev/examples/mp_data/mpjson.aselmdb"
|
|
18
|
+
matjson = json.load(open(mp_file))
|
|
18
19
|
db = LMDBDatabase(filename=save_file, readonly=False)
|
|
19
|
-
for key_1, val_1 in tqdm(
|
|
20
|
+
for key_1, val_1 in tqdm(matjson.items(), total=len(matjson.keys())):
|
|
20
21
|
for key_2, val_2 in val_1.items():
|
|
21
|
-
_atomrow, data =
|
|
22
|
+
_atomrow, data = cvt_mpdict_2_atomrow(val_2)
|
|
22
23
|
db._write(_atomrow, key_value_pairs={}, data=data)
|
|
23
24
|
db.close()
|
|
24
|
-
|
|
25
|
-
def
|
|
25
|
+
|
|
26
|
+
def cvt_mpdict_2_atomrow(config:dict):
|
|
26
27
|
cell = read_from_dict('matrix', config['structure']['lattice'], require=True)
|
|
27
28
|
atom_type_list = get_atomic_number_from_name([_['label'] for _ in config['structure']['sites']])
|
|
28
29
|
position = [_['xyz'] for _ in config['structure']['sites']]
|
|
@@ -60,26 +61,6 @@ def read_from_dict(key:str, config:dict, default=None, require=False):
|
|
|
60
61
|
raise ValueError("key {} not found in config".format(key))
|
|
61
62
|
else:
|
|
62
63
|
return default
|
|
63
|
-
|
|
64
|
-
# def test_lmdb():
|
|
65
|
-
# from pwdata.fairchem.datasets.ase_datasets import AseDBDataset
|
|
66
|
-
# search_dict = {'src': '/data/home/wuxingxing/codespace/pwdata/examples/meta_data/alex_val/alex_go_aao_001.aselmdb'}
|
|
67
|
-
# dataset = AseDBDataset(config=search_dict)
|
|
68
|
-
# atom_list = list(dataset.dbs[0].select("Li"))
|
|
69
|
-
# std = atom_list[0]
|
|
70
|
-
|
|
71
|
-
# search_dict = {'src': '/data/home/wuxingxing/codespace/pwdata/examples/MPtrj.aselmdb'}
|
|
72
|
-
# dataset2 = AseDBDataset(config=search_dict)
|
|
73
|
-
# atom_list2 = list(dataset2.dbs[0].select("Li"))
|
|
74
|
-
# dev = atom_list2[0]
|
|
75
|
-
|
|
76
|
-
# search_dict = {'src': '/data/home/wuxingxing/codespace/pwdata/examples/mp_data/sub.aselmdb'}
|
|
77
|
-
# dataset3 = AseDBDataset(config=search_dict)
|
|
78
|
-
# atom_list3 = list(dataset3.dbs[0].select())
|
|
79
|
-
# std3 = atom_list3[0]
|
|
80
|
-
|
|
81
|
-
# print()
|
|
82
|
-
|
|
83
64
|
if __name__=="__main__":
|
|
84
65
|
MPjson2lmdb()
|
|
85
66
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: pwdata is a data pre-processing tool for PWMLFF, 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
|
|
@@ -60,6 +60,8 @@ pwdata/pertub/__init__.py
|
|
|
60
60
|
pwdata/pertub/perturbation.py
|
|
61
61
|
pwdata/pertub/scale.py
|
|
62
62
|
pwdata/test/__init__.py
|
|
63
|
+
pwdata/test/matpbe2lmdb.py
|
|
64
|
+
pwdata/test/matrcan2lmdb.py
|
|
63
65
|
pwdata/test/mdtrajs2config.py
|
|
64
66
|
pwdata/test/mptraj2lmdb.py
|
|
65
67
|
pwdata/utils/__init__.py
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="pwdata",
|
|
8
|
-
version="0.
|
|
8
|
+
version="0.5.0",
|
|
9
9
|
author="LonxunQuantum",
|
|
10
10
|
author_email="lonxun@pwmat.com",
|
|
11
11
|
description="pwdata is a data pre-processing tool for PWMLFF, 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
|