dpdata 0.2.18__tar.gz → 0.2.20__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 (141) hide show
  1. dpdata-0.2.20/.git_archival.txt +3 -0
  2. dpdata-0.2.20/.gitattributes +1 -0
  3. dpdata-0.2.20/.github/workflows/benchmark.yml +23 -0
  4. dpdata-0.2.20/.github/workflows/pyright.yml +19 -0
  5. {dpdata-0.2.18 → dpdata-0.2.20}/.github/workflows/test.yml +4 -6
  6. {dpdata-0.2.18 → dpdata-0.2.20}/.github/workflows/test_import.yml +18 -17
  7. {dpdata-0.2.18 → dpdata-0.2.20}/.pre-commit-config.yaml +5 -3
  8. dpdata-0.2.20/PKG-INFO +266 -0
  9. dpdata-0.2.20/README.md +50 -0
  10. dpdata-0.2.20/benchmark/test_import.py +20 -0
  11. dpdata-0.2.20/dpdata/__about__.py +3 -0
  12. dpdata-0.2.20/dpdata/__init__.py +21 -0
  13. dpdata-0.2.20/dpdata/__main__.py +6 -0
  14. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/_version.py +2 -2
  15. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/abacus/md.py +10 -6
  16. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/abacus/relax.py +8 -4
  17. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/abacus/scf.py +20 -16
  18. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/amber/mask.py +2 -0
  19. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/amber/md.py +8 -4
  20. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/amber/sqm.py +12 -4
  21. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/ase_calculator.py +14 -9
  22. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/bond_order_system.py +8 -4
  23. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/cli.py +6 -7
  24. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/cp2k/cell.py +1 -0
  25. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/cp2k/output.py +2 -0
  26. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/data_type.py +9 -6
  27. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/deepmd/comp.py +49 -38
  28. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/deepmd/hdf5.py +23 -12
  29. dpdata-0.2.20/dpdata/deepmd/mixed.py +137 -0
  30. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/deepmd/raw.py +50 -43
  31. {dpdata-0.2.18/dpdata/fhi_aims → dpdata-0.2.20/dpdata/dftbplus}/__init__.py +0 -0
  32. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/dftbplus/output.py +13 -4
  33. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/driver.py +9 -6
  34. {dpdata-0.2.18/dpdata/gaussian → dpdata-0.2.20/dpdata/fhi_aims}/__init__.py +0 -0
  35. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/fhi_aims/output.py +8 -6
  36. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/format.py +10 -8
  37. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/gaussian/gjf.py +14 -19
  38. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/gaussian/log.py +11 -2
  39. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/gromacs/gro.py +10 -2
  40. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/lammps/dump.py +9 -2
  41. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/lammps/lmp.py +1 -0
  42. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/md/msd.py +2 -0
  43. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/md/pbc.py +2 -0
  44. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/md/rdf.py +2 -0
  45. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/md/water.py +2 -0
  46. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/openmx/omx.py +16 -7
  47. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/orca/output.py +73 -64
  48. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/periodic_table.py +23 -6
  49. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugin.py +2 -0
  50. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/3dmol.py +2 -2
  51. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/__init__.py +2 -0
  52. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/abacus.py +10 -2
  53. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/amber.py +5 -2
  54. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/ase.py +74 -29
  55. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/cp2k.py +2 -0
  56. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/deepmd.py +12 -4
  57. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/dftbplus.py +2 -0
  58. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/fhi_aims.py +2 -0
  59. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/gaussian.py +15 -8
  60. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/gromacs.py +12 -2
  61. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/lammps.py +12 -4
  62. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/list.py +2 -0
  63. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/n2p2.py +12 -4
  64. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/openmx.py +2 -0
  65. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/orca.py +58 -51
  66. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/psi4.py +110 -102
  67. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/pwmat.py +12 -4
  68. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/pymatgen.py +20 -0
  69. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/qe.py +2 -0
  70. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/rdkit.py +11 -7
  71. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/siesta.py +2 -0
  72. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/vasp.py +12 -5
  73. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/plugins/xyz.py +12 -4
  74. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/psi4/input.py +6 -1
  75. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/psi4/output.py +80 -74
  76. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/pwmat/atomconfig.py +3 -1
  77. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/pwmat/movement.py +2 -0
  78. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/pymatgen/molecule.py +5 -5
  79. dpdata-0.2.20/dpdata/pymatgen/structure.py +21 -0
  80. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/qe/scf.py +5 -2
  81. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/qe/traj.py +15 -7
  82. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/rdkit/sanitize.py +32 -16
  83. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/rdkit/utils.py +6 -4
  84. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/siesta/aiMD_output.py +1 -0
  85. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/siesta/output.py +1 -0
  86. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/stat.py +21 -9
  87. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/system.py +211 -104
  88. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/unit.py +3 -1
  89. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/utils.py +70 -1
  90. dpdata-0.2.20/dpdata/vasp/__init__.py +0 -0
  91. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/vasp/outcar.py +2 -0
  92. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/vasp/poscar.py +3 -2
  93. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/vasp/xml.py +1 -0
  94. dpdata-0.2.20/dpdata/xyz/__init__.py +0 -0
  95. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/xyz/quip_gap_xyz.py +2 -0
  96. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/xyz/xyz.py +2 -2
  97. dpdata-0.2.20/dpdata.egg-info/PKG-INFO +266 -0
  98. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata.egg-info/SOURCES.txt +9 -0
  99. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata.egg-info/requires.txt +11 -3
  100. {dpdata-0.2.18 → dpdata-0.2.20}/pyproject.toml +38 -4
  101. dpdata-0.2.18/PKG-INFO +0 -533
  102. dpdata-0.2.18/README.md +0 -323
  103. dpdata-0.2.18/dpdata/__about__.py +0 -1
  104. dpdata-0.2.18/dpdata/__init__.py +0 -43
  105. dpdata-0.2.18/dpdata/deepmd/mixed.py +0 -276
  106. dpdata-0.2.18/dpdata.egg-info/PKG-INFO +0 -533
  107. {dpdata-0.2.18 → dpdata-0.2.20}/.git-blame-ignore-revs +0 -0
  108. {dpdata-0.2.18 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  109. {dpdata-0.2.18 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  110. {dpdata-0.2.18 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  111. {dpdata-0.2.18 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/generic-issue.yml +0 -0
  112. {dpdata-0.2.18 → dpdata-0.2.20}/.github/dependabot.yml +0 -0
  113. {dpdata-0.2.18 → dpdata-0.2.20}/.github/workflows/mirror_gitee.yml +0 -0
  114. {dpdata-0.2.18 → dpdata-0.2.20}/.github/workflows/pub-pypi.yml +0 -0
  115. {dpdata-0.2.18 → dpdata-0.2.20}/.gitignore +0 -0
  116. {dpdata-0.2.18 → dpdata-0.2.20}/.readthedocs.yaml +0 -0
  117. {dpdata-0.2.18 → dpdata-0.2.20}/LICENSE +0 -0
  118. {dpdata-0.2.18 → dpdata-0.2.20}/MANIFEST.in +0 -0
  119. {dpdata-0.2.18/dpdata/abacus → dpdata-0.2.20/benchmark}/__init__.py +0 -0
  120. {dpdata-0.2.18/dpdata/amber → dpdata-0.2.20/dpdata/abacus}/__init__.py +0 -0
  121. {dpdata-0.2.18/dpdata/cp2k → dpdata-0.2.20/dpdata/amber}/__init__.py +0 -0
  122. {dpdata-0.2.18/dpdata/deepmd → dpdata-0.2.20/dpdata/cp2k}/__init__.py +0 -0
  123. {dpdata-0.2.18/dpdata/dftbplus → dpdata-0.2.20/dpdata/deepmd}/__init__.py +0 -0
  124. {dpdata-0.2.18/dpdata/gromacs → dpdata-0.2.20/dpdata/gaussian}/__init__.py +0 -0
  125. {dpdata-0.2.18/dpdata/lammps → dpdata-0.2.20/dpdata/gromacs}/__init__.py +0 -0
  126. {dpdata-0.2.18/dpdata/md → dpdata-0.2.20/dpdata/lammps}/__init__.py +0 -0
  127. {dpdata-0.2.18/dpdata/openmx → dpdata-0.2.20/dpdata/md}/__init__.py +0 -0
  128. {dpdata-0.2.18/dpdata/orca → dpdata-0.2.20/dpdata/openmx}/__init__.py +0 -0
  129. {dpdata-0.2.18/dpdata/psi4 → dpdata-0.2.20/dpdata/orca}/__init__.py +0 -0
  130. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata/periodic_table.json +0 -0
  131. {dpdata-0.2.18/dpdata/pwmat → dpdata-0.2.20/dpdata/psi4}/__init__.py +0 -0
  132. {dpdata-0.2.18/dpdata/pymatgen → dpdata-0.2.20/dpdata/pwmat}/__init__.py +0 -0
  133. /dpdata-0.2.18/dpdata/qe/__init__.py → /dpdata-0.2.20/dpdata/py.typed +0 -0
  134. {dpdata-0.2.18/dpdata/rdkit → dpdata-0.2.20/dpdata/pymatgen}/__init__.py +0 -0
  135. {dpdata-0.2.18/dpdata/siesta → dpdata-0.2.20/dpdata/qe}/__init__.py +0 -0
  136. {dpdata-0.2.18/dpdata/vasp → dpdata-0.2.20/dpdata/rdkit}/__init__.py +0 -0
  137. {dpdata-0.2.18/dpdata/xyz → dpdata-0.2.20/dpdata/siesta}/__init__.py +0 -0
  138. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata.egg-info/dependency_links.txt +0 -0
  139. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata.egg-info/entry_points.txt +0 -0
  140. {dpdata-0.2.18 → dpdata-0.2.20}/dpdata.egg-info/top_level.txt +0 -0
  141. {dpdata-0.2.18 → dpdata-0.2.20}/setup.cfg +0 -0
@@ -0,0 +1,3 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,23 @@
1
+ name: Benchmark
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+ benchmark:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: Set up Python
13
+ uses: actions/setup-python@v5
14
+ with:
15
+ python-version: 3.12
16
+ - run: curl -LsSf https://astral.sh/uv/install.sh | sh
17
+ - name: Install dependencies
18
+ run: uv pip install --system .[test,amber,ase,pymatgen,benchmark] rdkit openbabel-wheel
19
+ - name: Run benchmarks
20
+ uses: CodSpeedHQ/action@v3
21
+ with:
22
+ token: ${{ secrets.CODSPEED_TOKEN }}
23
+ run: pytest benchmark/ --codspeed
@@ -0,0 +1,19 @@
1
+ on:
2
+ - push
3
+ - pull_request
4
+
5
+ name: Type checker
6
+ jobs:
7
+ pyright:
8
+ name: pyright
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@master
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: '3.12'
15
+ - run: pip install uv
16
+ - run: uv pip install --system -e .[amber,ase,pymatgen] rdkit openbabel-wheel
17
+ - uses: jakebailey/pyright-action@v2
18
+ with:
19
+ version: 1.1.363
@@ -12,17 +12,15 @@ jobs:
12
12
  python-version: ["3.7", "3.8", "3.12"]
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
  # set up conda
17
17
  - name: Set up Python ${{ matrix.python-version }}
18
- uses: actions/setup-python@v4
18
+ uses: actions/setup-python@v5
19
19
  with:
20
20
  python-version: ${{ matrix.python-version }}
21
- # install rdkit and openbabel
22
- - name: Install rdkit
23
- run: python -m pip install rdkit openbabel-wheel
21
+ - run: curl -LsSf https://astral.sh/uv/install.sh | sh
24
22
  - name: Install dependencies
25
- run: python -m pip install .[amber,ase,pymatgen] coverage ./tests/plugin
23
+ run: uv pip install --system .[test,amber,ase,pymatgen] coverage ./tests/plugin rdkit openbabel-wheel
26
24
  - name: Test
27
25
  run: cd tests && coverage run --source=../dpdata -m unittest && cd .. && coverage combine tests/.coverage && coverage report
28
26
  - name: Run codecov
@@ -1,17 +1,18 @@
1
- name: test Python import
2
-
3
- on:
4
- - push
5
- - pull_request
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v2
12
- - uses: actions/setup-python@v2
13
- with:
14
- python-version: '3.9'
15
- architecture: 'x64'
16
- - run: python -m pip install .
17
- - run: python -c 'import dpdata'
1
+ name: test Python import
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: '3.9'
15
+ architecture: 'x64'
16
+ - run: python -m pip install uv
17
+ - run: python -m uv pip install --system .
18
+ - run: python -c 'import dpdata'
@@ -2,7 +2,7 @@
2
2
  # See https://pre-commit.com/hooks.html for more hooks
3
3
  repos:
4
4
  - repo: https://github.com/pre-commit/pre-commit-hooks
5
- rev: v4.5.0
5
+ rev: v4.6.0
6
6
  hooks:
7
7
  # there are many log files in tests
8
8
  # TODO: seperate py files and log files
@@ -16,10 +16,12 @@ repos:
16
16
  - id: check-merge-conflict
17
17
  - id: check-symlinks
18
18
  - id: check-toml
19
+ - id: mixed-line-ending
20
+ args: ["--fix=lf"]
19
21
  # Python
20
22
  - repo: https://github.com/astral-sh/ruff-pre-commit
21
23
  # Ruff version.
22
- rev: v0.3.5
24
+ rev: v0.6.3
23
25
  hooks:
24
26
  - id: ruff
25
27
  args: ["--fix"]
@@ -34,7 +36,7 @@ repos:
34
36
  args: ["--write"]
35
37
  # Python inside docs
36
38
  - repo: https://github.com/asottile/blacken-docs
37
- rev: 1.16.0
39
+ rev: 1.18.0
38
40
  hooks:
39
41
  - id: blacken-docs
40
42
  ci:
dpdata-0.2.20/PKG-INFO ADDED
@@ -0,0 +1,266 @@
1
+ Metadata-Version: 2.1
2
+ Name: dpdata
3
+ Version: 0.2.20
4
+ Summary: Manipulating data formats of DeePMD-kit, VASP, QE, PWmat, and LAMMPS, etc.
5
+ Author: DeepModeling
6
+ Author-email: Han Wang <wang_han@iapcm.ac.cn>
7
+ License: GNU LESSER GENERAL PUBLIC LICENSE
8
+ Version 3, 29 June 2007
9
+
10
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
11
+ Everyone is permitted to copy and distribute verbatim copies
12
+ of this license document, but changing it is not allowed.
13
+
14
+
15
+ This version of the GNU Lesser General Public License incorporates
16
+ the terms and conditions of version 3 of the GNU General Public
17
+ License, supplemented by the additional permissions listed below.
18
+
19
+ 0. Additional Definitions.
20
+
21
+ As used herein, "this License" refers to version 3 of the GNU Lesser
22
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
23
+ General Public License.
24
+
25
+ "The Library" refers to a covered work governed by this License,
26
+ other than an Application or a Combined Work as defined below.
27
+
28
+ An "Application" is any work that makes use of an interface provided
29
+ by the Library, but which is not otherwise based on the Library.
30
+ Defining a subclass of a class defined by the Library is deemed a mode
31
+ of using an interface provided by the Library.
32
+
33
+ A "Combined Work" is a work produced by combining or linking an
34
+ Application with the Library. The particular version of the Library
35
+ with which the Combined Work was made is also called the "Linked
36
+ Version".
37
+
38
+ The "Minimal Corresponding Source" for a Combined Work means the
39
+ Corresponding Source for the Combined Work, excluding any source code
40
+ for portions of the Combined Work that, considered in isolation, are
41
+ based on the Application, and not on the Linked Version.
42
+
43
+ The "Corresponding Application Code" for a Combined Work means the
44
+ object code and/or source code for the Application, including any data
45
+ and utility programs needed for reproducing the Combined Work from the
46
+ Application, but excluding the System Libraries of the Combined Work.
47
+
48
+ 1. Exception to Section 3 of the GNU GPL.
49
+
50
+ You may convey a covered work under sections 3 and 4 of this License
51
+ without being bound by section 3 of the GNU GPL.
52
+
53
+ 2. Conveying Modified Versions.
54
+
55
+ If you modify a copy of the Library, and, in your modifications, a
56
+ facility refers to a function or data to be supplied by an Application
57
+ that uses the facility (other than as an argument passed when the
58
+ facility is invoked), then you may convey a copy of the modified
59
+ version:
60
+
61
+ a) under this License, provided that you make a good faith effort to
62
+ ensure that, in the event an Application does not supply the
63
+ function or data, the facility still operates, and performs
64
+ whatever part of its purpose remains meaningful, or
65
+
66
+ b) under the GNU GPL, with none of the additional permissions of
67
+ this License applicable to that copy.
68
+
69
+ 3. Object Code Incorporating Material from Library Header Files.
70
+
71
+ The object code form of an Application may incorporate material from
72
+ a header file that is part of the Library. You may convey such object
73
+ code under terms of your choice, provided that, if the incorporated
74
+ material is not limited to numerical parameters, data structure
75
+ layouts and accessors, or small macros, inline functions and templates
76
+ (ten or fewer lines in length), you do both of the following:
77
+
78
+ a) Give prominent notice with each copy of the object code that the
79
+ Library is used in it and that the Library and its use are
80
+ covered by this License.
81
+
82
+ b) Accompany the object code with a copy of the GNU GPL and this license
83
+ document.
84
+
85
+ 4. Combined Works.
86
+
87
+ You may convey a Combined Work under terms of your choice that,
88
+ taken together, effectively do not restrict modification of the
89
+ portions of the Library contained in the Combined Work and reverse
90
+ engineering for debugging such modifications, if you also do each of
91
+ the following:
92
+
93
+ a) Give prominent notice with each copy of the Combined Work that
94
+ the Library is used in it and that the Library and its use are
95
+ covered by this License.
96
+
97
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
98
+ document.
99
+
100
+ c) For a Combined Work that displays copyright notices during
101
+ execution, include the copyright notice for the Library among
102
+ these notices, as well as a reference directing the user to the
103
+ copies of the GNU GPL and this license document.
104
+
105
+ d) Do one of the following:
106
+
107
+ 0) Convey the Minimal Corresponding Source under the terms of this
108
+ License, and the Corresponding Application Code in a form
109
+ suitable for, and under terms that permit, the user to
110
+ recombine or relink the Application with a modified version of
111
+ the Linked Version to produce a modified Combined Work, in the
112
+ manner specified by section 6 of the GNU GPL for conveying
113
+ Corresponding Source.
114
+
115
+ 1) Use a suitable shared library mechanism for linking with the
116
+ Library. A suitable mechanism is one that (a) uses at run time
117
+ a copy of the Library already present on the user's computer
118
+ system, and (b) will operate properly with a modified version
119
+ of the Library that is interface-compatible with the Linked
120
+ Version.
121
+
122
+ e) Provide Installation Information, but only if you would otherwise
123
+ be required to provide such information under section 6 of the
124
+ GNU GPL, and only to the extent that such information is
125
+ necessary to install and execute a modified version of the
126
+ Combined Work produced by recombining or relinking the
127
+ Application with a modified version of the Linked Version. (If
128
+ you use option 4d0, the Installation Information must accompany
129
+ the Minimal Corresponding Source and Corresponding Application
130
+ Code. If you use option 4d1, you must provide the Installation
131
+ Information in the manner specified by section 6 of the GNU GPL
132
+ for conveying Corresponding Source.)
133
+
134
+ 5. Combined Libraries.
135
+
136
+ You may place library facilities that are a work based on the
137
+ Library side by side in a single library together with other library
138
+ facilities that are not Applications and are not covered by this
139
+ License, and convey such a combined library under terms of your
140
+ choice, if you do both of the following:
141
+
142
+ a) Accompany the combined library with a copy of the same work based
143
+ on the Library, uncombined with any other library facilities,
144
+ conveyed under the terms of this License.
145
+
146
+ b) Give prominent notice with the combined library that part of it
147
+ is a work based on the Library, and explaining where to find the
148
+ accompanying uncombined form of the same work.
149
+
150
+ 6. Revised Versions of the GNU Lesser General Public License.
151
+
152
+ The Free Software Foundation may publish revised and/or new versions
153
+ of the GNU Lesser General Public License from time to time. Such new
154
+ versions will be similar in spirit to the present version, but may
155
+ differ in detail to address new problems or concerns.
156
+
157
+ Each version is given a distinguishing version number. If the
158
+ Library as you received it specifies that a certain numbered version
159
+ of the GNU Lesser General Public License "or any later version"
160
+ applies to it, you have the option of following the terms and
161
+ conditions either of that published version or of any later version
162
+ published by the Free Software Foundation. If the Library as you
163
+ received it does not specify a version number of the GNU Lesser
164
+ General Public License, you may choose any version of the GNU Lesser
165
+ General Public License ever published by the Free Software Foundation.
166
+
167
+ If the Library as you received it specifies that a proxy can decide
168
+ whether future versions of the GNU Lesser General Public License shall
169
+ apply, that proxy's public statement of acceptance of any version is
170
+ permanent authorization for you to choose that version for the
171
+ Library.
172
+
173
+ Project-URL: Homepage, https://github.com/deepmodeling/dpdata
174
+ Project-URL: documentation, https://docs.deepmodeling.com/projects/dpdata
175
+ Project-URL: repository, https://github.com/deepmodeling/dpdata
176
+ Keywords: lammps,vasp,deepmd-kit
177
+ Classifier: Programming Language :: Python :: 3.7
178
+ Classifier: Programming Language :: Python :: 3.8
179
+ Classifier: Programming Language :: Python :: 3.9
180
+ Classifier: Programming Language :: Python :: 3.10
181
+ Classifier: Programming Language :: Python :: 3.11
182
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
183
+ Requires-Python: >=3.7
184
+ Description-Content-Type: text/markdown
185
+ License-File: LICENSE
186
+ Requires-Dist: numpy>=1.14.3
187
+ Requires-Dist: monty
188
+ Requires-Dist: scipy
189
+ Requires-Dist: h5py
190
+ Requires-Dist: wcmatch
191
+ Requires-Dist: importlib_metadata>=1.4; python_version < "3.8"
192
+ Requires-Dist: typing_extensions; python_version < "3.8"
193
+ Provides-Extra: test
194
+ Requires-Dist: numpy<2; extra == "test"
195
+ Provides-Extra: ase
196
+ Requires-Dist: ase; extra == "ase"
197
+ Provides-Extra: amber
198
+ Requires-Dist: parmed; python_version >= "3.8" and extra == "amber"
199
+ Requires-Dist: parmed<4; python_version < "3.8" and extra == "amber"
200
+ Provides-Extra: pymatgen
201
+ Requires-Dist: pymatgen; extra == "pymatgen"
202
+ Provides-Extra: docs
203
+ Requires-Dist: sphinx; extra == "docs"
204
+ Requires-Dist: recommonmark; extra == "docs"
205
+ Requires-Dist: sphinx_rtd_theme>=1.0.0rc1; extra == "docs"
206
+ Requires-Dist: numpydoc; extra == "docs"
207
+ Requires-Dist: myst-parser; extra == "docs"
208
+ Requires-Dist: deepmodeling-sphinx>=0.1.1; extra == "docs"
209
+ Requires-Dist: sphinx-argparse<0.5.0; extra == "docs"
210
+ Requires-Dist: rdkit; extra == "docs"
211
+ Requires-Dist: jupyterlite-sphinx; extra == "docs"
212
+ Requires-Dist: jupyterlite-xeus; extra == "docs"
213
+ Provides-Extra: benchmark
214
+ Requires-Dist: pytest; extra == "benchmark"
215
+ Requires-Dist: pytest-codspeed; extra == "benchmark"
216
+
217
+ # dpdata
218
+
219
+ [![conda-forge](https://img.shields.io/conda/dn/conda-forge/dpdata?color=red&label=conda-forge&logo=conda-forge)](https://anaconda.org/conda-forge/dpdata)
220
+ [![pip install](https://img.shields.io/pypi/dm/dpdata?label=pip%20install&logo=pypi)](https://pypi.org/project/dpdata)
221
+ [![Documentation Status](https://readthedocs.org/projects/dpdata/badge/)](https://dpdata.readthedocs.io/)
222
+
223
+ **dpdata** is a Python package for manipulating atomistic data of software in computational science.
224
+
225
+ ## Installation
226
+
227
+ DP-GEN only supports Python 3.7 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install DP-GEN:
228
+
229
+ - Install via pip: `pip install dpdata`
230
+ - Install via conda: `conda install -c conda-forge dpdata`
231
+ - Install from source code: `git clone https://github.com/deepmodeling/dpdata && pip install ./dpdata`
232
+
233
+ To test if the installation is successful, you may execute
234
+
235
+ ```bash
236
+ dpdata --version
237
+ ```
238
+
239
+ ## Supported packages
240
+
241
+ `dpdata` is aimmed to support different kinds of atomistic packages:
242
+
243
+ - Atomistic machine learning packages, such as [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit);
244
+ - Molecular dynamics packages, such as [LAMMPS](https://github.com/lammps/lammps) and [GROMACS](https://gitlab.com/gromacs/gromacs);
245
+ - Quantum chemistry packages, such as [VASP](https://www.vasp.at/), [Gaussian](https://gaussian.com), and [ABACUS](https://github.com/deepmodeling/abacus-develop);
246
+ - Atomistic visualization packages, such as [3Dmol.js](https://3dmol.csb.pitt.edu/).
247
+ - Other atomistic tools, such as [ASE](https://gitlab.com/ase/ase).
248
+ - Common formats such as `xyz`.
249
+
250
+ All supported formats are listed [here](https://docs.deepmodeling.com/projects/dpdata/en/master/formats.html).
251
+
252
+ ## Quick start
253
+
254
+ The quickest way to convert a simple file from one format to another one is to use the [command line](https://docs.deepmodeling.com/projects/dpdata/en/master/cli.html).
255
+
256
+ ```sh
257
+ dpdata OUTCAR -i vasp/outcar -o deepmd/npy -O deepmd_data
258
+ ```
259
+
260
+ For advanced usage with Python APIs, [read dpdata documentation](https://docs.deepmodeling.com/projects/dpdata/).
261
+
262
+ ## Plugins
263
+
264
+ - [cp2kdata](https://github.com/robinzyb/cp2kdata) adds the latest CP2K support for dpdata.
265
+
266
+ For how to create your own plugin packages, [read dpdata documentation](https://docs.deepmodeling.com/projects/dpdata/).
@@ -0,0 +1,50 @@
1
+ # dpdata
2
+
3
+ [![conda-forge](https://img.shields.io/conda/dn/conda-forge/dpdata?color=red&label=conda-forge&logo=conda-forge)](https://anaconda.org/conda-forge/dpdata)
4
+ [![pip install](https://img.shields.io/pypi/dm/dpdata?label=pip%20install&logo=pypi)](https://pypi.org/project/dpdata)
5
+ [![Documentation Status](https://readthedocs.org/projects/dpdata/badge/)](https://dpdata.readthedocs.io/)
6
+
7
+ **dpdata** is a Python package for manipulating atomistic data of software in computational science.
8
+
9
+ ## Installation
10
+
11
+ DP-GEN only supports Python 3.7 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install DP-GEN:
12
+
13
+ - Install via pip: `pip install dpdata`
14
+ - Install via conda: `conda install -c conda-forge dpdata`
15
+ - Install from source code: `git clone https://github.com/deepmodeling/dpdata && pip install ./dpdata`
16
+
17
+ To test if the installation is successful, you may execute
18
+
19
+ ```bash
20
+ dpdata --version
21
+ ```
22
+
23
+ ## Supported packages
24
+
25
+ `dpdata` is aimmed to support different kinds of atomistic packages:
26
+
27
+ - Atomistic machine learning packages, such as [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit);
28
+ - Molecular dynamics packages, such as [LAMMPS](https://github.com/lammps/lammps) and [GROMACS](https://gitlab.com/gromacs/gromacs);
29
+ - Quantum chemistry packages, such as [VASP](https://www.vasp.at/), [Gaussian](https://gaussian.com), and [ABACUS](https://github.com/deepmodeling/abacus-develop);
30
+ - Atomistic visualization packages, such as [3Dmol.js](https://3dmol.csb.pitt.edu/).
31
+ - Other atomistic tools, such as [ASE](https://gitlab.com/ase/ase).
32
+ - Common formats such as `xyz`.
33
+
34
+ All supported formats are listed [here](https://docs.deepmodeling.com/projects/dpdata/en/master/formats.html).
35
+
36
+ ## Quick start
37
+
38
+ The quickest way to convert a simple file from one format to another one is to use the [command line](https://docs.deepmodeling.com/projects/dpdata/en/master/cli.html).
39
+
40
+ ```sh
41
+ dpdata OUTCAR -i vasp/outcar -o deepmd/npy -O deepmd_data
42
+ ```
43
+
44
+ For advanced usage with Python APIs, [read dpdata documentation](https://docs.deepmodeling.com/projects/dpdata/).
45
+
46
+ ## Plugins
47
+
48
+ - [cp2kdata](https://github.com/robinzyb/cp2kdata) adds the latest CP2K support for dpdata.
49
+
50
+ For how to create your own plugin packages, [read dpdata documentation](https://docs.deepmodeling.com/projects/dpdata/).
@@ -0,0 +1,20 @@
1
+ from __future__ import annotations
2
+
3
+ import subprocess
4
+ import sys
5
+
6
+ import pytest
7
+
8
+
9
+ @pytest.mark.benchmark
10
+ def test_import():
11
+ """Test import dpdata."""
12
+ subprocess.check_output(
13
+ [sys.executable, "-c", "'from dpdata import LabeledSystem'"]
14
+ ).decode("ascii")
15
+
16
+
17
+ @pytest.mark.benchmark
18
+ def test_cli():
19
+ """Test dpdata command."""
20
+ subprocess.check_output([sys.executable, "-m", "dpdata", "-h"]).decode("ascii")
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "unknown"
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from . import lammps, md, vasp
4
+ from .bond_order_system import BondOrderSystem
5
+ from .system import LabeledSystem, MultiSystems, System
6
+
7
+ try:
8
+ from ._version import version as __version__
9
+ except ImportError:
10
+ from .__about__ import __version__
11
+
12
+ __all__ = [
13
+ "__version__",
14
+ "lammps",
15
+ "md",
16
+ "vasp",
17
+ "System",
18
+ "LabeledSystem",
19
+ "MultiSystems",
20
+ "BondOrderSystem",
21
+ ]
@@ -0,0 +1,6 @@
1
+ from __future__ import annotations
2
+
3
+ from dpdata.cli import dpdata_cli
4
+
5
+ if __name__ == "__main__":
6
+ dpdata_cli()
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.18'
16
- __version_tuple__ = version_tuple = (0, 2, 18)
15
+ __version__ = version = '0.2.20'
16
+ __version_tuple__ = version_tuple = (0, 2, 20)
@@ -1,8 +1,12 @@
1
+ from __future__ import annotations
2
+
1
3
  import os
2
4
  import warnings
3
5
 
4
6
  import numpy as np
5
7
 
8
+ from dpdata.utils import open_file
9
+
6
10
  from .scf import (
7
11
  bohr2ang,
8
12
  get_cell,
@@ -28,7 +32,7 @@ def get_path_out(fname, inlines):
28
32
  for line in inlines:
29
33
  if len(line) > 0 and "suffix" in line and "suffix" == line.split()[0]:
30
34
  suffix = line.split()[1]
31
- path_out = os.path.join(fname, "OUT.%s/" % suffix)
35
+ path_out = os.path.join(fname, f"OUT.{suffix}/")
32
36
  break
33
37
  return path_out
34
38
 
@@ -154,12 +158,12 @@ def get_frame(fname):
154
158
  path_in = os.path.join(fname, "INPUT")
155
159
  else:
156
160
  raise RuntimeError("invalid input")
157
- with open(path_in) as fp:
161
+ with open_file(path_in) as fp:
158
162
  inlines = fp.read().split("\n")
159
163
  geometry_path_in = get_geometry_in(fname, inlines) # base dir of STRU
160
164
  path_out = get_path_out(fname, inlines)
161
165
 
162
- with open(geometry_path_in) as fp:
166
+ with open_file(geometry_path_in) as fp:
163
167
  geometry_inlines = fp.read().split("\n")
164
168
  celldm, cell = get_cell(geometry_inlines)
165
169
  atom_names, natoms, types, coords = get_coords(
@@ -170,11 +174,11 @@ def get_frame(fname):
170
174
  # ndump = int(os.popen("ls -l %s | grep 'md_pos_' | wc -l" %path_out).readlines()[0])
171
175
  # number of dumped geometry files
172
176
  # coords = get_coords_from_cif(ndump, dump_freq, atom_names, natoms, types, path_out, cell)
173
- with open(os.path.join(path_out, "MD_dump")) as fp:
177
+ with open_file(os.path.join(path_out, "MD_dump")) as fp:
174
178
  dumplines = fp.read().split("\n")
175
179
  coords, cells, force, stress = get_coords_from_dump(dumplines, natoms)
176
180
  ndump = np.shape(coords)[0]
177
- with open(os.path.join(path_out, "running_md.log")) as fp:
181
+ with open_file(os.path.join(path_out, "running_md.log")) as fp:
178
182
  outlines = fp.read().split("\n")
179
183
  energy = get_energy(outlines, ndump, dump_freq)
180
184
 
@@ -189,7 +193,7 @@ def get_frame(fname):
189
193
  unconv_stru += "%d " % i
190
194
  ndump = len(energy)
191
195
  if unconv_stru != "":
192
- warnings.warn("Structure %s are unconverged and not collected!" % unconv_stru)
196
+ warnings.warn(f"Structure {unconv_stru} are unconverged and not collected!")
193
197
 
194
198
  for iframe in range(ndump):
195
199
  stress[iframe] *= np.linalg.det(cells[iframe, :, :].reshape([3, 3]))
@@ -1,7 +1,11 @@
1
+ from __future__ import annotations
2
+
1
3
  import os
2
4
 
3
5
  import numpy as np
4
6
 
7
+ from dpdata.utils import open_file
8
+
5
9
  from .scf import (
6
10
  bohr2ang,
7
11
  collect_force,
@@ -172,10 +176,10 @@ def get_frame(fname):
172
176
  path_in = os.path.join(fname, "INPUT")
173
177
  else:
174
178
  raise RuntimeError("invalid input")
175
- with open(path_in) as fp:
179
+ with open_file(path_in) as fp:
176
180
  inlines = fp.read().split("\n")
177
181
  geometry_path_in = get_geometry_in(fname, inlines) # base dir of STRU
178
- with open(geometry_path_in) as fp:
182
+ with open_file(geometry_path_in) as fp:
179
183
  geometry_inlines = fp.read().split("\n")
180
184
  celldm, cell = get_cell(geometry_inlines)
181
185
  atom_names, natoms, types, coord_tmp = get_coords(
@@ -183,8 +187,8 @@ def get_frame(fname):
183
187
  )
184
188
 
185
189
  logf = get_log_file(fname, inlines)
186
- assert os.path.isfile(logf), "Error: can not find %s" % logf
187
- with open(logf) as f1:
190
+ assert os.path.isfile(logf), f"Error: can not find {logf}"
191
+ with open_file(logf) as f1:
188
192
  lines = f1.readlines()
189
193
 
190
194
  atomnumber = 0