pwdata 0.2.13__tar.gz → 0.2.15__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 (37) hide show
  1. {pwdata-0.2.13 → pwdata-0.2.15}/PKG-INFO +1 -1
  2. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/build/supercells.py +1 -1
  3. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/build/write_struc.py +30 -24
  4. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata.egg-info/PKG-INFO +1 -1
  5. {pwdata-0.2.13 → pwdata-0.2.15}/setup.py +1 -1
  6. {pwdata-0.2.13 → pwdata-0.2.15}/LICENSE +0 -0
  7. {pwdata-0.2.13 → pwdata-0.2.15}/README.md +0 -0
  8. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/__init__.py +0 -0
  9. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/atomconfig.py +0 -0
  10. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/build/__init__.py +0 -0
  11. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/build/cell.py +0 -0
  12. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/build/geometry.py +0 -0
  13. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/calculators/__init__.py +0 -0
  14. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/calculators/const.py +0 -0
  15. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/calculators/unitconvert_lmps.py +0 -0
  16. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/calculators/units.py +0 -0
  17. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/cp2kdata.py +0 -0
  18. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/datasets_saver.py +0 -0
  19. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/deepmd.py +0 -0
  20. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/dump.py +0 -0
  21. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/extendedxyz.py +0 -0
  22. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/image.py +0 -0
  23. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/lammpsdata.py +0 -0
  24. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/lmps.py +0 -0
  25. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/main.py +0 -0
  26. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/movement.py +0 -0
  27. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/movement_saver.py +0 -0
  28. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/outcar.py +0 -0
  29. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/pertub/__init__.py +0 -0
  30. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/pertub/perturbation.py +0 -0
  31. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/pertub/scale.py +0 -0
  32. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/poscar.py +0 -0
  33. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata/pwmlff.py +0 -0
  34. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata.egg-info/SOURCES.txt +0 -0
  35. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata.egg-info/dependency_links.txt +0 -0
  36. {pwdata-0.2.13 → pwdata-0.2.15}/pwdata.egg-info/top_level.txt +0 -0
  37. {pwdata-0.2.13 → pwdata-0.2.15}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.2.13
3
+ Version: 0.2.15
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
@@ -21,7 +21,7 @@ def make_supercell(image_data, supercell_matrix: list, pbc: list = None, wrap=Tr
21
21
  lattice_points_frac = lattice_points_in_supercell(supercell_matrix)
22
22
  lattice_points = np.dot(lattice_points_frac, supercell)
23
23
 
24
- superatoms = Image(lattice=supercell, pbc=pbc)
24
+ superatoms = Image(lattice=supercell, pbc=pbc, atom_type=image_data.atom_type)
25
25
  for lp in lattice_points:
26
26
  shifted_atoms = prim.copy()
27
27
  shifted_atoms.arrays['position'] += lp
@@ -82,22 +82,24 @@ def write_config(image,
82
82
 
83
83
  if sort:
84
84
  if len(image.get_atomic_numbers()) == 0:
85
- ind = np.argsort(image.atom_types_image)
86
- symbols = np.array(image.atom_types_image)[ind]
85
+ atom_types_image = np.array(image.atom_types_image)
86
+ indices_dict = {type: np.where(atom_types_image == type)[0] for type in image.atom_type}
87
+ sorted_indices = np.concatenate([np.sort(indices) for indices in indices_dict.values()])
88
+ symbols = atom_types_image[sorted_indices]
87
89
  else:
88
- ind = np.argsort(image.get_atomic_numbers())
89
- symbols = np.array(image.get_atomic_numbers())[ind]
90
- coord = np.array(coord)[ind]
90
+ sorted_indices = np.argsort(image.get_atomic_numbers())
91
+ symbols = np.array(image.get_atomic_numbers())[sorted_indices]
92
+ coord = np.array(coord)[sorted_indices]
91
93
  # if constraints:
92
94
  # sflags = sflags[ind]
93
95
  else:
94
96
  symbols = image.atom_types_image
95
-
97
+
96
98
  # Create a list sc of (symbol, count) pairs
97
99
  if symbol_count:
98
100
  # sc = symbol_count
99
101
  pass
100
- elif image.atom_type is None:
102
+ elif image.atom_type_num is None:
101
103
  sc = Counter(symbols)
102
104
  atom_type = list(sc.keys())
103
105
  atom_type_num = list(sc.values())
@@ -196,32 +198,35 @@ def write_vasp(image,
196
198
  'VASP requires that the direction of FixedLine '
197
199
  'constraints is parallel with one of the cell axis')
198
200
  sflags[constr.a] = ~mask'''
199
-
201
+
202
+
200
203
  if sort:
201
204
  if len(image.get_atomic_numbers()) == 0:
202
- ind = np.argsort(image.atom_types_image)
203
- symbols = np.array(image.atom_types_image)[ind]
205
+ atom_types_image = np.array(image.atom_types_image)
206
+ indices_dict = {type: np.where(atom_types_image == type)[0] for type in image.atom_type}
207
+ sorted_indices = np.concatenate([np.sort(indices) for indices in indices_dict.values()])
208
+ symbols = atom_types_image[sorted_indices]
204
209
  else:
205
- ind = np.argsort(image.get_atomic_numbers())
206
- symbols = np.array(image.get_atomic_numbers())[ind]
207
- coord = np.array(coord)[ind]
210
+ sorted_indices = np.argsort(image.get_atomic_numbers())
211
+ symbols = np.array(image.get_atomic_numbers())[sorted_indices]
212
+ coord = np.array(coord)[sorted_indices]
208
213
  # if constraints:
209
214
  # sflags = sflags[ind]
210
215
  else:
211
216
  symbols = image.atom_types_image
212
-
217
+
213
218
  # Create a list sc of (symbol, count) pairs
214
219
  if symbol_count:
215
220
  # sc = symbol_count
216
221
  pass
217
- elif image.atom_type is None:
222
+ elif image.atom_type_num is None:
218
223
  sc = Counter(symbols)
219
224
  atom_type = list(sc.keys())
220
225
  atom_type_num = list(sc.values())
221
226
  else:
222
227
  atom_type = image.atom_type
223
228
  atom_type_num = image.atom_type_num
224
-
229
+
225
230
  atom_type = [elements[_] for _ in atom_type]
226
231
  # Write to file
227
232
  output_file = open(os.path.join(filepath, data_name), 'w')
@@ -298,25 +303,26 @@ def write_lammps(image,
298
303
  image._set_orthorhombic()
299
304
  coord = image._set_cartesian().position
300
305
 
301
-
302
306
  if sort:
303
307
  if len(image.get_atomic_numbers()) == 0:
304
- ind = np.argsort(image.atom_types_image)
305
- symbols = np.array(image.atom_types_image)[ind]
308
+ atom_types_image = np.array(image.atom_types_image)
309
+ indices_dict = {type: np.where(atom_types_image == type)[0] for type in image.atom_type}
310
+ sorted_indices = np.concatenate([np.sort(indices) for indices in indices_dict.values()])
311
+ symbols = atom_types_image[sorted_indices]
306
312
  else:
307
- ind = np.argsort(image.get_atomic_numbers())
308
- symbols = np.array(image.get_atomic_numbers())[ind]
309
- coord = np.array(coord)[ind]
313
+ sorted_indices = np.argsort(image.get_atomic_numbers())
314
+ symbols = np.array(image.get_atomic_numbers())[sorted_indices]
315
+ coord = np.array(coord)[sorted_indices]
310
316
  # if constraints:
311
317
  # sflags = sflags[ind]
312
318
  else:
313
319
  symbols = image.atom_types_image
314
-
320
+
315
321
  # Create a list sc of (symbol, count) pairs
316
322
  if symbol_count:
317
323
  # sc = symbol_count
318
324
  pass
319
- elif image.atom_type is None:
325
+ elif image.atom_type_num is None:
320
326
  sc = Counter(symbols)
321
327
  atom_type = list(sc.keys())
322
328
  atom_type_num = list(sc.values())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.2.13
3
+ Version: 0.2.15
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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="pwdata",
8
- version="0.2.13",
8
+ version="0.2.15",
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