pwdata 0.5.6__tar.gz → 0.5.6.dev0__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.

Files changed (82) hide show
  1. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/PKG-INFO +1 -1
  2. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/check_envs.py +1 -1
  3. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/PKG-INFO +1 -1
  4. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/SOURCES.txt +0 -1
  5. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/setup.py +1 -1
  6. pwdata-0.5.6/pwdata/test/lmdb2aselmdb.py +0 -131
  7. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/LICENSE +0 -0
  8. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/README.md +0 -0
  9. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/__init__.py +0 -0
  10. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/atomconfig.py +0 -0
  11. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/build/__init__.py +0 -0
  12. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/build/cell.py +0 -0
  13. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/build/geometry.py +0 -0
  14. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/build/supercells.py +0 -0
  15. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/build/write_struc.py +0 -0
  16. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/calculators/__init__.py +0 -0
  17. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/calculators/const.py +0 -0
  18. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/calculators/unitconvert_lmps.py +0 -0
  19. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/calculators/units.py +0 -0
  20. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/config.py +0 -0
  21. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/convert_files.py +0 -0
  22. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/cp2kdata.py +0 -0
  23. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/datasets_saver.py +0 -0
  24. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/deepmd.py +0 -0
  25. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/dump.py +0 -0
  26. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/extendedxyz.py +0 -0
  27. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/__init__.py +0 -0
  28. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/common/__init__.py +0 -0
  29. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/common/registry.py +0 -0
  30. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/common/typing.py +0 -0
  31. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/common/utils.py +0 -0
  32. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/__init__.py +0 -0
  33. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/_utils.py +0 -0
  34. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/ase_datasets.py +0 -0
  35. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/base_dataset.py +0 -0
  36. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/embeddings/__init__.py +0 -0
  37. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/embeddings/atomic_radii.py +0 -0
  38. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/embeddings/continuous_embeddings.py +0 -0
  39. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/embeddings/khot_embeddings.py +0 -0
  40. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/embeddings/qmof_khot_embeddings.py +0 -0
  41. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/lmdb_database.py +0 -0
  42. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/datasets/target_metadata_guesser.py +0 -0
  43. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/modules/__init__.py +0 -0
  44. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/modules/transforms.py +0 -0
  45. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/fairchem/preprocessing/__init__.py +0 -0
  46. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/image.py +0 -0
  47. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/lammpsdata.py +0 -0
  48. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/lmps.py +0 -0
  49. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/main.py +0 -0
  50. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/meta.py +0 -0
  51. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/meta_omol.py +0 -0
  52. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/molecule.py +0 -0
  53. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/movement.py +0 -0
  54. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/movement_saver.py +0 -0
  55. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/outcar.py +0 -0
  56. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/pertub/__init__.py +0 -0
  57. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/pertub/perturbation.py +0 -0
  58. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/pertub/scale.py +0 -0
  59. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/poscar.py +0 -0
  60. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/pwmlff.py +0 -0
  61. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/__init__.py +0 -0
  62. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/bamboo2lmdb.py +0 -0
  63. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/extact_outcar_with_ml.py +0 -0
  64. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/matpbe2lmdb.py +0 -0
  65. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/matrcan2lmdb.py +0 -0
  66. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/mdtrajs2config.py +0 -0
  67. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/mptraj2lmdb.py +0 -0
  68. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/oc25.py +0 -0
  69. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/omol25.py +0 -0
  70. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/outcar2mvms.py +0 -0
  71. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/readasedb.py +0 -0
  72. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test/surf_test.py +0 -0
  73. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/test.py +0 -0
  74. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/tmp.py +0 -0
  75. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/utils/__init__.py +0 -0
  76. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/utils/constant.py +0 -0
  77. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata/utils/format_change.py +0 -0
  78. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/dependency_links.txt +0 -0
  79. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/entry_points.txt +0 -0
  80. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/requires.txt +0 -0
  81. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/pwdata.egg-info/top_level.txt +0 -0
  82. {pwdata-0.5.6 → pwdata-0.5.6.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.5.6
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
@@ -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: Under Development (2025.12.24)\n"
18
+ info += "surf or surface: Under Development (2025.10.31)\n"
19
19
  info += "\n"
20
20
 
21
21
  info += "perturb:\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.5.6
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
@@ -65,7 +65,6 @@ pwdata/pertub/scale.py
65
65
  pwdata/test/__init__.py
66
66
  pwdata/test/bamboo2lmdb.py
67
67
  pwdata/test/extact_outcar_with_ml.py
68
- pwdata/test/lmdb2aselmdb.py
69
68
  pwdata/test/matpbe2lmdb.py
70
69
  pwdata/test/matrcan2lmdb.py
71
70
  pwdata/test/mdtrajs2config.py
@@ -11,7 +11,7 @@ with open("README.md", "r") as fh:
11
11
 
12
12
  setuptools.setup(
13
13
  name="pwdata",
14
- version="0.5.6",
14
+ version="0.5.6dev0",
15
15
  author="LonxunQuantum",
16
16
  author_email="lonxun@pwmat.com",
17
17
  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.",
@@ -1,131 +0,0 @@
1
- import os
2
- import glob
3
- from ase import Atoms
4
- from ase.db.row import AtomsRow
5
- from pwdata.utils.constant import get_atomic_number_from_name
6
- from tqdm import tqdm
7
- import numpy as np
8
- import torch
9
- from pwdata.fairchem.datasets.ase_datasets import LMDBDatabase
10
-
11
- atomic_number_to_symbol = {
12
- 1: 'H', 2: 'He', 3: 'Li', 4: 'Be', 5: 'B', 6: 'C', 7: 'N', 8: 'O', 9: 'F', 10: 'Ne',
13
- 11: 'Na', 12: 'Mg', 13: 'Al', 14: 'Si', 15: 'P', 16: 'S', 17: 'Cl', 18: 'Ar', 19: 'K', 20: 'Ca',
14
- 21: 'Sc', 22: 'Ti', 23: 'V', 24: 'Cr', 25: 'Mn', 26: 'Fe', 27: 'Co', 28: 'Ni', 29: 'Cu', 30: 'Zn',
15
- 31: 'Ga', 32: 'Ge', 33: 'As', 34: 'Se', 35: 'Br', 36: 'Kr', 37: 'Rb', 38: 'Sr', 39: 'Y', 40: 'Zr',
16
- 41: 'Nb', 42: 'Mo', 43: 'Tc', 44: 'Ru', 45: 'Rh', 46: 'Pd', 47: 'Ag', 48: 'Cd', 49: 'In', 50: 'Sn',
17
- 51: 'Sb', 52: 'Te', 53: 'I', 54: 'Xe', 55: 'Cs', 56: 'Ba', 57: 'La', 58: 'Ce', 59: 'Pr', 60: 'Nd',
18
- 61: 'Pm', 62: 'Sm', 63: 'Eu', 64: 'Gd', 65: 'Tb', 66: 'Dy', 67: 'Ho', 68: 'Er', 69: 'Tm', 70: 'Yb',
19
- 71: 'Lu', 72: 'Hf', 73: 'Ta', 74: 'W', 75: 'Re', 76: 'Os', 77: 'Ir', 78: 'Pt', 79: 'Au', 80: 'Hg',
20
- 81: 'Tl', 82: 'Pb', 83: 'Bi', 84: 'Po', 85: 'At', 86: 'Rn', 87: 'Fr', 88: 'Ra', 89: 'Ac', 90: 'Th',
21
- 91: 'Pa', 92: 'U', 93: 'Np', 94: 'Pu', 95: 'Am', 96: 'Cm', 97: 'Bk', 98: 'Cf', 99: 'Es', 100: 'Fm',
22
- 101: 'Md', 102: 'No', 103: 'Lr', 104: 'Rf', 105: 'Db', 106: 'Sg', 107: 'Bh', 108: 'Hs', 109: 'Mt',
23
- 110: 'Ds', 111: 'Rg', 112: 'Cn', 113: 'Nh', 114: 'Fl', 115: 'Mc', 116: 'Lv', 117: 'Ts', 118: 'Og'
24
- }
25
-
26
- def cvt_matdict_2_atomrow(config:dict):
27
- cell = read_from_dict('matrix', config['structure']['lattice'], require=True)
28
- atom_type_list = get_atomic_number_from_name([_['label'] for _ in config['structure']['sites']])
29
- position = [_['xyz'] for _ in config['structure']['sites']]
30
- magmom = [_['properties']['magmom'] for _ in config['structure']['sites']]
31
- # magmom = read_from_dict('magmom', config, require=True)
32
- atom = Atoms(positions=position,
33
- numbers=atom_type_list,
34
- magmoms=magmom,
35
- cell=cell)
36
-
37
- atom_rows = AtomsRow(atom)
38
- atom_rows.pbc = np.ones(3, bool)
39
- # read stress -> xx, yy, zz, yz, xz, xy
40
- virial = read_from_dict('stress', config, require=True) # this is vrial and the order is xx, yy, zz, yz, xz, xy
41
- stress = -np.array(virial) / config['volume']
42
- atom_rows.stress = [stress[0],stress[1],stress[2],stress[3],stress[4],stress[5]]
43
- force = read_from_dict('forces', config, require=True) #mat is s
44
- energy = read_from_dict('energy', config, require=True)
45
- atom_rows.__setattr__('force', force)
46
- atom_rows.__setattr__('forces', force)
47
- atom_rows.__setattr__('energy', energy)
48
- data = {}
49
- return atom_rows, data
50
-
51
- def read_from_dict(key:str, config:dict, default=None, require=False):
52
- if key in config:
53
- return config[key]
54
- else:
55
- if require:
56
- raise ValueError("key {} not found in config".format(key))
57
- else:
58
- return default
59
-
60
- def atom_type_to_symbol(atom_type):
61
- return atomic_number_to_symbol.get(int(atom_type), 'X') # Default to 'X' for unknown types
62
-
63
- def atom_types_to_symbol(atom_types):
64
- return [atom_type_to_symbol(atom) for atom in atom_types]
65
-
66
- # xyz_file = "/data/home/wuxingxing/codespace/EDM/outputs/edm_qm9/eval/stabel_pwmat/0/molecule_stable_000.xyz"
67
- # atoms = read(xyz_file)
68
- # atoms.center(vacuum=8)
69
- # # 获取原子符号列表,并排序
70
- # symbols = atoms.get_chemical_symbols()
71
- # sorted_indices = sorted(range(len(symbols)), key=lambda i: symbols[i])
72
-
73
- # # 按排序后的索引重新排列原子
74
- # atoms_sorted = atoms[sorted_indices]
75
-
76
- # save_file = "/data/home/wuxingxing/codespace/EDM/outputs/edm_qm9/bk_eval/stabel_pwmat/0/sort.0.POSCAR"
77
- # write(filename=save_file, images=atoms_sorted, format="vasp")
78
-
79
- def read2atoms(pt_file, db, prefix):
80
- atom_row_list = []
81
- val = torch.load(pt_file, map_location="cpu")
82
- # Get the necessary tensors
83
- cumsum_atom = val['cumsum_atom'].numpy() # Convert to numpy for easier handling
84
- positions = val['pos'].numpy() # Shape: [410945, 3]
85
- atom_types = val['atom_types'].numpy() # Shape: [410945]
86
- forces = val['forces'].numpy()
87
- charges = val['charge'].numpy()
88
- for id, i in tqdm(enumerate(range(len(cumsum_atom) - 1)), total=len(cumsum_atom) - 1, desc="bamboo ptfile to aselmdb"):
89
- start_idx = cumsum_atom[i]
90
- end_idx = cumsum_atom[i + 1]
91
- energy = val['energy'][id].item()
92
- # Get positions and atom types for the current structure
93
- struct_pos = positions[start_idx:end_idx]
94
- struct_types = atom_types[start_idx:end_idx]
95
- force = forces[start_idx:end_idx]
96
- charge = charges[start_idx:end_idx]
97
- symbol = atom_types_to_symbol(struct_types)
98
- atom = Atoms(symbols=symbol,
99
- positions=struct_pos,
100
- charges=charge,
101
- pbc=False)
102
- atom.center(vacuum=5)
103
- atom_rows = AtomsRow(atom)
104
- atom_rows.__setattr__('force', force)
105
- atom_rows.__setattr__('forces', force)
106
- atom_rows.__setattr__('energy', energy)
107
- data = {}
108
- data['total_charge'] = val['total_charge'][id].item()
109
- data['dipole'] = list(val['dipole'][id].numpy())
110
- data['quadrupole'] = list(val['quadrupole'][id].numpy())
111
- data["idx"] = f"{id}-{prefix}"
112
- db._write(atom_rows, key_value_pairs={}, data=data)
113
- atom_row_list.append(atom_rows)
114
- db.close()
115
-
116
- def cvtbamboo(pt_dir, save_dir, prefix):
117
- pt_list = glob.glob(os.path.join(pt_dir, "*.lmdb"))
118
- for pt in pt_list:
119
- save_path = os.path.join(save_dir, os.path.basename(pt).replace('.lmdb', '.aselmdb'))
120
- source = LMDBDatabase(filename=pt, readonly=True)
121
- db = LMDBDatabase(filename=save_path, readonly=False)
122
- atom_row_list = read2atoms(pt, db, prefix)
123
-
124
-
125
- if __name__=="__main__":
126
- pt_dir="/data/public/wuxingxing/catalyticLAM/metal/train"
127
- save_dir="/data/public/wuxingxing/catalyticLAM/metal/train/tmp"
128
- if not os.path.exists(save_dir):
129
- os.makedirs(save_dir)
130
- prefix = "2d"
131
- cvtbamboo(pt_dir, save_dir, prefix)
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