pwdata 0.5.3__tar.gz → 0.5.4.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 (78) hide show
  1. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/PKG-INFO +1 -1
  2. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/deepmd.py +6 -5
  3. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/lammpsdata.py +3 -1
  4. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/meta.py +19 -18
  5. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/pwmlff.py +9 -8
  6. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/bamboo2lmdb.py +3 -3
  7. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/PKG-INFO +1 -1
  8. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/setup.py +1 -1
  9. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/LICENSE +0 -0
  10. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/README.md +0 -0
  11. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/__init__.py +0 -0
  12. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/atomconfig.py +0 -0
  13. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/build/__init__.py +0 -0
  14. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/build/cell.py +0 -0
  15. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/build/geometry.py +0 -0
  16. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/build/supercells.py +0 -0
  17. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/build/write_struc.py +0 -0
  18. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/calculators/__init__.py +0 -0
  19. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/calculators/const.py +0 -0
  20. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/calculators/unitconvert_lmps.py +0 -0
  21. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/calculators/units.py +0 -0
  22. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/check_envs.py +0 -0
  23. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/config.py +0 -0
  24. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/convert_files.py +0 -0
  25. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/cp2kdata.py +0 -0
  26. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/datasets_saver.py +0 -0
  27. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/dump.py +0 -0
  28. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/extendedxyz.py +0 -0
  29. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/__init__.py +0 -0
  30. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/common/__init__.py +0 -0
  31. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/common/registry.py +0 -0
  32. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/common/typing.py +0 -0
  33. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/common/utils.py +0 -0
  34. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/__init__.py +0 -0
  35. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/_utils.py +0 -0
  36. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/ase_datasets.py +0 -0
  37. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/base_dataset.py +0 -0
  38. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/embeddings/__init__.py +0 -0
  39. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/embeddings/atomic_radii.py +0 -0
  40. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/embeddings/continuous_embeddings.py +0 -0
  41. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/embeddings/khot_embeddings.py +0 -0
  42. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/embeddings/qmof_khot_embeddings.py +0 -0
  43. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/lmdb_database.py +0 -0
  44. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/datasets/target_metadata_guesser.py +0 -0
  45. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/modules/__init__.py +0 -0
  46. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/modules/transforms.py +0 -0
  47. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/fairchem/preprocessing/__init__.py +0 -0
  48. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/image.py +0 -0
  49. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/lmps.py +0 -0
  50. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/main.py +0 -0
  51. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/meta_omol.py +0 -0
  52. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/molecule.py +0 -0
  53. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/movement.py +0 -0
  54. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/movement_saver.py +0 -0
  55. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/outcar.py +0 -0
  56. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/pertub/__init__.py +0 -0
  57. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/pertub/perturbation.py +0 -0
  58. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/pertub/scale.py +0 -0
  59. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/poscar.py +0 -0
  60. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/__init__.py +0 -0
  61. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/extact_outcar_with_ml.py +0 -0
  62. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/matpbe2lmdb.py +0 -0
  63. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/matrcan2lmdb.py +0 -0
  64. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/mdtrajs2config.py +0 -0
  65. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/mptraj2lmdb.py +0 -0
  66. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/omol25.py +0 -0
  67. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test/outcar2mvms.py +0 -0
  68. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/test.py +0 -0
  69. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/tmp.py +0 -0
  70. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/utils/__init__.py +0 -0
  71. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/utils/constant.py +0 -0
  72. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata/utils/format_change.py +0 -0
  73. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/SOURCES.txt +0 -0
  74. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/dependency_links.txt +0 -0
  75. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/entry_points.txt +0 -0
  76. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/requires.txt +0 -0
  77. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/pwdata.egg-info/top_level.txt +0 -0
  78. {pwdata-0.5.3 → pwdata-0.5.4.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.5.3
3
+ Version: 0.5.4.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
@@ -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
- if "box" in npy_file:
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 npy_file:
58
+ elif "coord" in npy_file_name:
58
59
  coord = np.load(npy_file).reshape(-1, atom_nums, 3)
59
- elif "energy" in npy_file:
60
+ elif "energy" in npy_file_name:
60
61
  energy = np.load(npy_file)
61
- elif "force" in npy_file:
62
+ elif "force" in npy_file_name:
62
63
  force = np.load(npy_file).reshape(-1, atom_nums, 3)
63
- elif "virial" in npy_file:
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
- # atom_lists = []
57
- # for i, _ in enumerate(input):
58
- # print(i)
59
- # _atom_lists = load_and_query_db(_, atom_types, query, filter_with_elements)
60
- # for _ in _atom_lists:
61
- # print(_.formula)
62
- # atom_lists.extend(_atom_lists)
63
- # 使用多进程并行加载和查询数据库
64
- with ProcessPoolExecutor(max_workers=cpu_nums) as executor:
65
- futures = []
66
- for db_address in input:
67
- futures.append(executor.submit(load_and_query_db, db_address, atom_types, query, filter_with_elements))
68
-
69
- # 收集查询结果
70
- atom_lists = []
71
- for future in as_completed(futures):
72
- atom_lists.append(future.result())
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
- if "atom_type" in npy_file:
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 npy_file:
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 npy_file:
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 npy_file:
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 npy_file:
50
+ elif "image_type.npy" in npy_file_name:
50
51
  atom_types_image = np.load(npy_file).squeeze()
51
- elif "lattice" in npy_file:
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 npy_file:
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 npy_file:
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/train"
126
- save_dir="/share/public/PWMLFF_test_data/bamboo/train_aselmdb"
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-train"
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
3
+ Version: 0.5.4.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
@@ -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.3",
8
+ version="0.5.4.dev",
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