pwdata 0.2.11__tar.gz → 0.2.13__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.11 → pwdata-0.2.13}/PKG-INFO +1 -1
  2. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/deepmd.py +3 -1
  3. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/extendedxyz.py +1 -1
  4. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/image.py +6 -4
  5. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/outcar.py +4 -1
  6. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/pwmlff.py +3 -1
  7. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata.egg-info/PKG-INFO +1 -1
  8. {pwdata-0.2.11 → pwdata-0.2.13}/setup.py +1 -1
  9. {pwdata-0.2.11 → pwdata-0.2.13}/LICENSE +0 -0
  10. {pwdata-0.2.11 → pwdata-0.2.13}/README.md +0 -0
  11. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/__init__.py +0 -0
  12. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/atomconfig.py +0 -0
  13. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/build/__init__.py +0 -0
  14. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/build/cell.py +0 -0
  15. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/build/geometry.py +0 -0
  16. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/build/supercells.py +0 -0
  17. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/build/write_struc.py +0 -0
  18. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/calculators/__init__.py +0 -0
  19. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/calculators/const.py +0 -0
  20. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/calculators/unitconvert_lmps.py +0 -0
  21. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/calculators/units.py +0 -0
  22. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/cp2kdata.py +0 -0
  23. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/datasets_saver.py +0 -0
  24. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/dump.py +0 -0
  25. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/lammpsdata.py +0 -0
  26. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/lmps.py +0 -0
  27. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/main.py +0 -0
  28. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/movement.py +0 -0
  29. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/movement_saver.py +0 -0
  30. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/pertub/__init__.py +0 -0
  31. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/pertub/perturbation.py +0 -0
  32. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/pertub/scale.py +0 -0
  33. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata/poscar.py +0 -0
  34. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata.egg-info/SOURCES.txt +0 -0
  35. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata.egg-info/dependency_links.txt +0 -0
  36. {pwdata-0.2.11 → pwdata-0.2.13}/pwdata.egg-info/top_level.txt +0 -0
  37. {pwdata-0.2.11 → pwdata-0.2.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.2.11
3
+ Version: 0.2.13
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
@@ -40,7 +40,8 @@ class DPNPY(object):
40
40
  box, coord, energy, force, virial, image_nums = self.load_npy(npy_files, atom_nums)
41
41
 
42
42
  for i in range(image_nums):
43
- image = Image(lattice=box[i], position=coord[i], force=force[i], Ep=energy[i], stress=virial[i],
43
+ virial_image = virial[i] if virial is not None else None
44
+ image = Image(lattice=box[i], position=coord[i], force=force[i], Ep=energy[i], stress=virial_image,
44
45
  atom_type=atom_type, atom_nums=atom_nums, atom_types_image=atom_types_image, atom_type_num=atom_type_num,
45
46
  cartesian=True, image_nums=i)
46
47
  atomic_energy, _, _, _ = np.linalg.lstsq([atom_type_num], np.array([image.Ep]), rcond=1e-3)
@@ -49,6 +50,7 @@ class DPNPY(object):
49
50
  self.image_list.append(image)
50
51
 
51
52
  def load_npy(self, npy_files, atom_nums):
53
+ virial = None
52
54
  for npy_file in tqdm(npy_files, desc="Loading data"):
53
55
  if "box" in npy_file:
54
56
  box = np.load(npy_file).reshape(-1, 3, 3).astype(np.float64)
@@ -9,7 +9,7 @@ def save_to_extxyz(image_data_all: list, output_path: str, data_name: str, write
9
9
  image_data._set_cartesian()
10
10
  data_name.write("%d\n" % image_data.atom_nums)
11
11
  # data_name.write("Iteration: %s\n" % image_data.iteration)
12
- output_head = 'Lattice="%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f" Properties=species:S:1:pos:R:3:force:R:3:local_energy:R:1 pbc="T T T" energy={}\n'.format(image_data.Ep)
12
+ output_head = 'Lattice="%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f" Properties=species:S:1:pos:R:3:forces:R:3:local_energy:R:1 pbc="T T T" energy={}\n'.format(image_data.Ep)
13
13
  output_extended = (image_data.lattice[0][0], image_data.lattice[0][1], image_data.lattice[0][2],
14
14
  image_data.lattice[1][0], image_data.lattice[1][1], image_data.lattice[1][2],
15
15
  image_data.lattice[2][0], image_data.lattice[2][1], image_data.lattice[2][2])
@@ -239,10 +239,12 @@ def elements_to_order(atom_names, atom_types_image, atom_nums):
239
239
  Returns:
240
240
  list: Updated list of atom types per atom.
241
241
  """
242
- for idx, name in enumerate(atom_names):
243
- for ii in range(atom_nums):
244
- if name in elements and atom_types_image[ii] == idx+1:
245
- atom_types_image[ii] = elements.index(name)
242
+ # for idx, name in enumerate(atom_names):
243
+ # for ii in range(atom_nums):
244
+ # if name in elements and atom_types_image[ii] == idx+1:
245
+ # atom_types_image[ii] = elements.index(name)
246
+ type_mapping = {idx+1: elements.index(name) for idx, name in enumerate(atom_names)}
247
+ atom_types_image = [type_mapping[atom_type] for atom_type in atom_types_image]
246
248
  return atom_types_image
247
249
 
248
250
  def frac2cart(position, lattice):
@@ -26,7 +26,10 @@ class OUTCAR(object):
26
26
  # get atom names from POTCAR info, tested only for PAW_PBE ...
27
27
  _ii = ii.split()[2]
28
28
  if '_' in _ii:
29
- atom_names.append(_ii.split('_')[0])
29
+ # atom_names.append(_ii.split('_')[0])
30
+ atom_name = _ii.split('_')[0]
31
+ if atom_name not in atom_names:
32
+ atom_names.append(atom_name)
30
33
  else:
31
34
  atom_name = _ii
32
35
  if atom_name not in atom_names:
@@ -22,6 +22,7 @@ class PWNPY(object):
22
22
  atom_type, atomic_energy, Ep, force, atom_types_image, lattice, coord, stress, image_nums, atom_nums = self.load_npy(npy_files)
23
23
  lattice = lattice.reshape(-1, 3, 3)
24
24
  coord = coord.reshape(-1, atom_nums, 3)
25
+ force = force.reshape(-1, atom_nums, 3)
25
26
  for i in tqdm(range(image_nums), desc="Loading data"):
26
27
  image = Image(lattice=lattice[i], position=coord[i], force=force[i], Ep=Ep[i], stress=stress[i],
27
28
  cartesian=False, image_nums=i, atom_nums=atom_nums,
@@ -55,5 +56,6 @@ class PWNPY(object):
55
56
 
56
57
  image_nums = len(Ep)
57
58
  atom_nums = len(atom_types_image)
59
+ stress = stress.reshape(-1, 3, 3) if stress is not None else None
58
60
 
59
- return atom_type, atomic_energy.squeeze(), Ep.squeeze(), force.squeeze(), atom_types_image, lattice.squeeze(), coord.squeeze(), stress.squeeze(), image_nums, atom_nums
61
+ return atom_type, atomic_energy, Ep.squeeze(), force, atom_types_image, lattice, coord, stress, image_nums, atom_nums
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pwdata
3
- Version: 0.2.11
3
+ Version: 0.2.13
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.11",
8
+ version="0.2.13",
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