dpdata 0.2.23__tar.gz → 0.2.24__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.
Files changed (136) hide show
  1. {dpdata-0.2.23 → dpdata-0.2.24}/.pre-commit-config.yaml +1 -1
  2. {dpdata-0.2.23 → dpdata-0.2.24}/PKG-INFO +3 -2
  3. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/_version.py +9 -4
  4. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/abacus/stru.py +15 -3
  5. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/system.py +1 -3
  6. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/PKG-INFO +3 -2
  7. {dpdata-0.2.23 → dpdata-0.2.24}/.git-blame-ignore-revs +0 -0
  8. {dpdata-0.2.23 → dpdata-0.2.24}/.git_archival.txt +0 -0
  9. {dpdata-0.2.23 → dpdata-0.2.24}/.gitattributes +0 -0
  10. {dpdata-0.2.23 → dpdata-0.2.24}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  11. {dpdata-0.2.23 → dpdata-0.2.24}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  12. {dpdata-0.2.23 → dpdata-0.2.24}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  13. {dpdata-0.2.23 → dpdata-0.2.24}/.github/ISSUE_TEMPLATE/generic-issue.yml +0 -0
  14. {dpdata-0.2.23 → dpdata-0.2.24}/.github/dependabot.yml +0 -0
  15. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/benchmark.yml +0 -0
  16. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/mirror_gitee.yml +0 -0
  17. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/pub-pypi.yml +0 -0
  18. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/pyright.yml +0 -0
  19. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/test.yml +0 -0
  20. {dpdata-0.2.23 → dpdata-0.2.24}/.github/workflows/test_import.yml +0 -0
  21. {dpdata-0.2.23 → dpdata-0.2.24}/.gitignore +0 -0
  22. {dpdata-0.2.23 → dpdata-0.2.24}/.readthedocs.yaml +0 -0
  23. {dpdata-0.2.23 → dpdata-0.2.24}/LICENSE +0 -0
  24. {dpdata-0.2.23 → dpdata-0.2.24}/MANIFEST.in +0 -0
  25. {dpdata-0.2.23 → dpdata-0.2.24}/README.md +0 -0
  26. {dpdata-0.2.23 → dpdata-0.2.24}/benchmark/__init__.py +0 -0
  27. {dpdata-0.2.23 → dpdata-0.2.24}/benchmark/test_import.py +0 -0
  28. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/__about__.py +0 -0
  29. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/__init__.py +0 -0
  30. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/__main__.py +0 -0
  31. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/abacus/__init__.py +0 -0
  32. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/abacus/md.py +0 -0
  33. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/abacus/relax.py +0 -0
  34. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/abacus/scf.py +0 -0
  35. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/amber/__init__.py +0 -0
  36. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/amber/mask.py +0 -0
  37. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/amber/md.py +0 -0
  38. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/amber/sqm.py +0 -0
  39. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/ase_calculator.py +0 -0
  40. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/bond_order_system.py +0 -0
  41. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/cli.py +0 -0
  42. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/cp2k/__init__.py +0 -0
  43. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/cp2k/cell.py +0 -0
  44. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/cp2k/output.py +0 -0
  45. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/data_type.py +0 -0
  46. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/deepmd/__init__.py +0 -0
  47. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/deepmd/comp.py +0 -0
  48. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/deepmd/hdf5.py +0 -0
  49. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/deepmd/mixed.py +0 -0
  50. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/deepmd/raw.py +0 -0
  51. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/dftbplus/__init__.py +0 -0
  52. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/dftbplus/output.py +0 -0
  53. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/driver.py +0 -0
  54. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/fhi_aims/__init__.py +0 -0
  55. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/fhi_aims/output.py +0 -0
  56. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/format.py +0 -0
  57. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/gaussian/__init__.py +0 -0
  58. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/gaussian/gjf.py +0 -0
  59. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/gaussian/log.py +0 -0
  60. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/gromacs/__init__.py +0 -0
  61. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/gromacs/gro.py +0 -0
  62. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/lammps/__init__.py +0 -0
  63. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/lammps/dump.py +0 -0
  64. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/lammps/lmp.py +0 -0
  65. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/md/__init__.py +0 -0
  66. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/md/msd.py +0 -0
  67. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/md/pbc.py +0 -0
  68. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/md/rdf.py +0 -0
  69. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/md/water.py +0 -0
  70. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/openmx/__init__.py +0 -0
  71. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/openmx/omx.py +0 -0
  72. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/orca/__init__.py +0 -0
  73. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/orca/output.py +0 -0
  74. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/periodic_table.json +0 -0
  75. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/periodic_table.py +0 -0
  76. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugin.py +0 -0
  77. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/3dmol.py +0 -0
  78. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/__init__.py +0 -0
  79. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/abacus.py +0 -0
  80. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/amber.py +0 -0
  81. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/ase.py +0 -0
  82. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/cp2k.py +0 -0
  83. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/deepmd.py +0 -0
  84. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/dftbplus.py +0 -0
  85. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/fhi_aims.py +0 -0
  86. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/gaussian.py +0 -0
  87. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/gromacs.py +0 -0
  88. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/lammps.py +0 -0
  89. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/list.py +0 -0
  90. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/n2p2.py +0 -0
  91. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/openmx.py +0 -0
  92. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/orca.py +0 -0
  93. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/psi4.py +0 -0
  94. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/pwmat.py +0 -0
  95. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/pymatgen.py +0 -0
  96. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/qe.py +0 -0
  97. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/rdkit.py +0 -0
  98. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/siesta.py +0 -0
  99. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/vasp.py +0 -0
  100. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/plugins/xyz.py +0 -0
  101. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/psi4/__init__.py +0 -0
  102. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/psi4/input.py +0 -0
  103. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/psi4/output.py +0 -0
  104. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pwmat/__init__.py +0 -0
  105. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pwmat/atomconfig.py +0 -0
  106. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pwmat/movement.py +0 -0
  107. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/py.typed +0 -0
  108. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pymatgen/__init__.py +0 -0
  109. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pymatgen/molecule.py +0 -0
  110. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/pymatgen/structure.py +0 -0
  111. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/qe/__init__.py +0 -0
  112. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/qe/scf.py +0 -0
  113. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/qe/traj.py +0 -0
  114. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/rdkit/__init__.py +0 -0
  115. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/rdkit/sanitize.py +0 -0
  116. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/rdkit/utils.py +0 -0
  117. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/siesta/__init__.py +0 -0
  118. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/siesta/aiMD_output.py +0 -0
  119. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/siesta/output.py +0 -0
  120. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/stat.py +0 -0
  121. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/unit.py +0 -0
  122. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/utils.py +0 -0
  123. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/vasp/__init__.py +0 -0
  124. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/vasp/outcar.py +0 -0
  125. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/vasp/poscar.py +0 -0
  126. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/vasp/xml.py +0 -0
  127. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/xyz/__init__.py +0 -0
  128. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/xyz/quip_gap_xyz.py +0 -0
  129. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata/xyz/xyz.py +0 -0
  130. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/SOURCES.txt +0 -0
  131. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/dependency_links.txt +0 -0
  132. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/entry_points.txt +0 -0
  133. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/requires.txt +0 -0
  134. {dpdata-0.2.23 → dpdata-0.2.24}/dpdata.egg-info/top_level.txt +0 -0
  135. {dpdata-0.2.23 → dpdata-0.2.24}/pyproject.toml +0 -0
  136. {dpdata-0.2.23 → dpdata-0.2.24}/setup.cfg +0 -0
@@ -21,7 +21,7 @@ repos:
21
21
  # Python
22
22
  - repo: https://github.com/astral-sh/ruff-pre-commit
23
23
  # Ruff version.
24
- rev: v0.9.6
24
+ rev: v0.11.0
25
25
  hooks:
26
26
  - id: ruff
27
27
  args: ["--fix"]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: dpdata
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary: Manipulating data formats of DeePMD-kit, VASP, QE, PWmat, and LAMMPS, etc.
5
5
  Author: DeepModeling
6
6
  Author-email: Han Wang <wang_han@iapcm.ac.cn>
@@ -211,6 +211,7 @@ Requires-Dist: jupyterlite-xeus; extra == "docs"
211
211
  Provides-Extra: benchmark
212
212
  Requires-Dist: pytest; extra == "benchmark"
213
213
  Requires-Dist: pytest-codspeed; extra == "benchmark"
214
+ Dynamic: license-file
214
215
 
215
216
  # dpdata
216
217
 
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.2.23'
16
- __version_tuple__ = version_tuple = (0, 2, 23)
20
+ __version__ = version = '0.2.24'
21
+ __version_tuple__ = version_tuple = (0, 2, 24)
@@ -362,6 +362,7 @@ def parse_pos(coords_lines, atom_names, celldm, cell):
362
362
 
363
363
  ntype = len(atom_names)
364
364
  line_idx = 1 # starting line of first element
365
+ define_atom_mag = False
365
366
  for it in range(ntype):
366
367
  atom_name = coords_lines[line_idx].split()[0]
367
368
  if atom_name != atom_names[it]:
@@ -390,6 +391,9 @@ def parse_pos(coords_lines, atom_names, celldm, cell):
390
391
  mag = [0, 0, atom_type_mag]
391
392
  mags.append(mag)
392
393
 
394
+ if imagmom is not None:
395
+ define_atom_mag = True
396
+
393
397
  line_idx += 1
394
398
  coords = np.array(coords) # need transformation!!!
395
399
 
@@ -409,7 +413,11 @@ def parse_pos(coords_lines, atom_names, celldm, cell):
409
413
  if all([i is None for i in lambda_]):
410
414
  lambda_ = []
411
415
 
412
- mags = np.array(mags)
416
+ # here return the magnetic moment only when the atom magnetic moment is specified.
417
+ if not define_atom_mag:
418
+ mags = []
419
+ else:
420
+ mags = np.array(mags)
413
421
 
414
422
  return atom_numbs, coords, move, mags, velocity, sc, lambda_
415
423
 
@@ -438,10 +446,13 @@ def get_frame_from_stru(stru):
438
446
 
439
447
  "cells": list of cell vectors,
440
448
  "coords": list of atomic coordinates,
441
- "spins": list of magnetic moments,
449
+ "spins": list of magnetic moments, # return only when set "mag xxx" for each atom in STRU file
442
450
  "moves": list of move flags,
443
451
  }
444
452
  For some keys, if the information is not provided in the STRU file, then it will not be included in the dictionary.
453
+ "spins" is designed for delta spin calculation, and when dpdata.System is write to lmp format, the spin will be written as magmom.
454
+ But we should note that this file format is valid only for a spin lammps job, not for a normal job.
455
+ If you want to use dpgen to run the non-spin job, then you should not define "mag x x x" in the STRU file.
445
456
  """
446
457
  if not os.path.isfile(stru):
447
458
  raise FileNotFoundError(f"ABACUS STRU file {stru} not found!!!")
@@ -472,8 +483,9 @@ def get_frame_from_stru(stru):
472
483
  "pp_files": pp_files,
473
484
  "cells": np.array([cell]),
474
485
  "coords": np.array([coords]),
475
- "spins": np.array([mags]),
476
486
  }
487
+ if len(mags) > 0:
488
+ data["spins"] = np.array([mags])
477
489
  if len(orb_files) > 0:
478
490
  data["orb_files"] = orb_files
479
491
  if len(dpks_descriptor) > 0:
@@ -710,9 +710,7 @@ class System:
710
710
 
711
711
  @post_funcs.register("shift_orig_zero")
712
712
  def _shift_orig_zero(self):
713
- for ff in self.data["coords"]:
714
- for ii in ff:
715
- ii = ii - self.data["orig"]
713
+ self.data["coords"] = self.data["coords"] - self.data["orig"]
716
714
  self.data["orig"] = self.data["orig"] - self.data["orig"]
717
715
  assert (np.zeros([3]) == self.data["orig"]).all()
718
716
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: dpdata
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary: Manipulating data formats of DeePMD-kit, VASP, QE, PWmat, and LAMMPS, etc.
5
5
  Author: DeepModeling
6
6
  Author-email: Han Wang <wang_han@iapcm.ac.cn>
@@ -211,6 +211,7 @@ Requires-Dist: jupyterlite-xeus; extra == "docs"
211
211
  Provides-Extra: benchmark
212
212
  Requires-Dist: pytest; extra == "benchmark"
213
213
  Requires-Dist: pytest-codspeed; extra == "benchmark"
214
+ Dynamic: license-file
214
215
 
215
216
  # dpdata
216
217
 
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
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