dpdata 0.2.19__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 (139) hide show
  1. {dpdata-0.2.19 → dpdata-0.2.20}/.git_archival.txt +0 -1
  2. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/benchmark.yml +4 -4
  3. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/test.yml +1 -1
  4. {dpdata-0.2.19 → dpdata-0.2.20}/.pre-commit-config.yaml +2 -2
  5. dpdata-0.2.20/PKG-INFO +266 -0
  6. dpdata-0.2.20/README.md +50 -0
  7. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/_version.py +2 -2
  8. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/abacus/md.py +6 -4
  9. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/abacus/relax.py +5 -3
  10. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/abacus/scf.py +8 -6
  11. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/amber/md.py +4 -3
  12. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/amber/sqm.py +10 -4
  13. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/deepmd/comp.py +47 -38
  14. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/deepmd/hdf5.py +15 -5
  15. dpdata-0.2.20/dpdata/deepmd/mixed.py +137 -0
  16. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/deepmd/raw.py +48 -43
  17. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/dftbplus/output.py +12 -3
  18. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/gaussian/log.py +9 -2
  19. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/gromacs/gro.py +8 -2
  20. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/lammps/dump.py +8 -2
  21. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/openmx/omx.py +14 -7
  22. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/orca/output.py +11 -2
  23. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/abacus.py +8 -2
  24. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/amber.py +2 -1
  25. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/gaussian.py +12 -7
  26. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/gromacs.py +10 -2
  27. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/lammps.py +10 -4
  28. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/n2p2.py +10 -4
  29. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/orca.py +7 -2
  30. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/psi4.py +10 -4
  31. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/pwmat.py +10 -4
  32. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/vasp.py +10 -5
  33. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/xyz.py +10 -4
  34. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/psi4/output.py +8 -2
  35. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/qe/scf.py +4 -2
  36. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/qe/traj.py +13 -7
  37. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/utils.py +45 -1
  38. dpdata-0.2.20/dpdata.egg-info/PKG-INFO +266 -0
  39. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata.egg-info/requires.txt +5 -2
  40. {dpdata-0.2.19 → dpdata-0.2.20}/pyproject.toml +7 -2
  41. dpdata-0.2.19/PKG-INFO +0 -537
  42. dpdata-0.2.19/README.md +0 -323
  43. dpdata-0.2.19/dpdata/deepmd/mixed.py +0 -278
  44. dpdata-0.2.19/dpdata.egg-info/PKG-INFO +0 -537
  45. {dpdata-0.2.19 → dpdata-0.2.20}/.git-blame-ignore-revs +0 -0
  46. {dpdata-0.2.19 → dpdata-0.2.20}/.gitattributes +0 -0
  47. {dpdata-0.2.19 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  48. {dpdata-0.2.19 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  49. {dpdata-0.2.19 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  50. {dpdata-0.2.19 → dpdata-0.2.20}/.github/ISSUE_TEMPLATE/generic-issue.yml +0 -0
  51. {dpdata-0.2.19 → dpdata-0.2.20}/.github/dependabot.yml +0 -0
  52. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/mirror_gitee.yml +0 -0
  53. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/pub-pypi.yml +0 -0
  54. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/pyright.yml +0 -0
  55. {dpdata-0.2.19 → dpdata-0.2.20}/.github/workflows/test_import.yml +0 -0
  56. {dpdata-0.2.19 → dpdata-0.2.20}/.gitignore +0 -0
  57. {dpdata-0.2.19 → dpdata-0.2.20}/.readthedocs.yaml +0 -0
  58. {dpdata-0.2.19 → dpdata-0.2.20}/LICENSE +0 -0
  59. {dpdata-0.2.19 → dpdata-0.2.20}/MANIFEST.in +0 -0
  60. {dpdata-0.2.19 → dpdata-0.2.20}/benchmark/__init__.py +0 -0
  61. {dpdata-0.2.19 → dpdata-0.2.20}/benchmark/test_import.py +0 -0
  62. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/__about__.py +0 -0
  63. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/__init__.py +0 -0
  64. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/__main__.py +0 -0
  65. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/abacus/__init__.py +0 -0
  66. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/amber/__init__.py +0 -0
  67. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/amber/mask.py +0 -0
  68. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/ase_calculator.py +0 -0
  69. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/bond_order_system.py +0 -0
  70. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/cli.py +0 -0
  71. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/cp2k/__init__.py +0 -0
  72. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/cp2k/cell.py +0 -0
  73. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/cp2k/output.py +0 -0
  74. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/data_type.py +0 -0
  75. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/deepmd/__init__.py +0 -0
  76. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/dftbplus/__init__.py +0 -0
  77. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/driver.py +0 -0
  78. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/fhi_aims/__init__.py +0 -0
  79. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/fhi_aims/output.py +0 -0
  80. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/format.py +0 -0
  81. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/gaussian/__init__.py +0 -0
  82. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/gaussian/gjf.py +0 -0
  83. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/gromacs/__init__.py +0 -0
  84. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/lammps/__init__.py +0 -0
  85. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/lammps/lmp.py +0 -0
  86. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/md/__init__.py +0 -0
  87. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/md/msd.py +0 -0
  88. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/md/pbc.py +0 -0
  89. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/md/rdf.py +0 -0
  90. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/md/water.py +0 -0
  91. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/openmx/__init__.py +0 -0
  92. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/orca/__init__.py +0 -0
  93. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/periodic_table.json +0 -0
  94. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/periodic_table.py +0 -0
  95. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugin.py +0 -0
  96. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/3dmol.py +0 -0
  97. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/__init__.py +0 -0
  98. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/ase.py +0 -0
  99. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/cp2k.py +0 -0
  100. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/deepmd.py +0 -0
  101. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/dftbplus.py +0 -0
  102. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/fhi_aims.py +0 -0
  103. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/list.py +0 -0
  104. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/openmx.py +0 -0
  105. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/pymatgen.py +0 -0
  106. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/qe.py +0 -0
  107. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/rdkit.py +0 -0
  108. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/plugins/siesta.py +0 -0
  109. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/psi4/__init__.py +0 -0
  110. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/psi4/input.py +0 -0
  111. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pwmat/__init__.py +0 -0
  112. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pwmat/atomconfig.py +0 -0
  113. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pwmat/movement.py +0 -0
  114. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/py.typed +0 -0
  115. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pymatgen/__init__.py +0 -0
  116. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pymatgen/molecule.py +0 -0
  117. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/pymatgen/structure.py +0 -0
  118. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/qe/__init__.py +0 -0
  119. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/rdkit/__init__.py +0 -0
  120. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/rdkit/sanitize.py +0 -0
  121. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/rdkit/utils.py +0 -0
  122. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/siesta/__init__.py +0 -0
  123. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/siesta/aiMD_output.py +0 -0
  124. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/siesta/output.py +0 -0
  125. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/stat.py +0 -0
  126. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/system.py +0 -0
  127. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/unit.py +0 -0
  128. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/vasp/__init__.py +0 -0
  129. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/vasp/outcar.py +0 -0
  130. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/vasp/poscar.py +0 -0
  131. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/vasp/xml.py +0 -0
  132. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/xyz/__init__.py +0 -0
  133. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/xyz/quip_gap_xyz.py +0 -0
  134. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata/xyz/xyz.py +0 -0
  135. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata.egg-info/SOURCES.txt +0 -0
  136. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata.egg-info/dependency_links.txt +0 -0
  137. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata.egg-info/entry_points.txt +0 -0
  138. {dpdata-0.2.19 → dpdata-0.2.20}/dpdata.egg-info/top_level.txt +0 -0
  139. {dpdata-0.2.19 → dpdata-0.2.20}/setup.cfg +0 -0
@@ -1,4 +1,3 @@
1
1
  node: $Format:%H$
2
2
  node-date: $Format:%cI$
3
3
  describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
- ref-names: $Format:%D$
@@ -1,11 +1,11 @@
1
- name: Python package
1
+ name: Benchmark
2
2
 
3
3
  on:
4
4
  - push
5
5
  - pull_request
6
6
 
7
7
  jobs:
8
- build:
8
+ benchmark:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - uses: actions/checkout@v4
@@ -15,9 +15,9 @@ jobs:
15
15
  python-version: 3.12
16
16
  - run: curl -LsSf https://astral.sh/uv/install.sh | sh
17
17
  - name: Install dependencies
18
- run: uv pip install --system .[amber,ase,pymatgen,benchmark] rdkit openbabel-wheel
18
+ run: uv pip install --system .[test,amber,ase,pymatgen,benchmark] rdkit openbabel-wheel
19
19
  - name: Run benchmarks
20
- uses: CodSpeedHQ/action@v2
20
+ uses: CodSpeedHQ/action@v3
21
21
  with:
22
22
  token: ${{ secrets.CODSPEED_TOKEN }}
23
23
  run: pytest benchmark/ --codspeed
@@ -20,7 +20,7 @@ jobs:
20
20
  python-version: ${{ matrix.python-version }}
21
21
  - run: curl -LsSf https://astral.sh/uv/install.sh | sh
22
22
  - name: Install dependencies
23
- run: uv pip install --system .[amber,ase,pymatgen] coverage ./tests/plugin rdkit openbabel-wheel
23
+ run: uv pip install --system .[test,amber,ase,pymatgen] coverage ./tests/plugin rdkit openbabel-wheel
24
24
  - name: Test
25
25
  run: cd tests && coverage run --source=../dpdata -m unittest && cd .. && coverage combine tests/.coverage && coverage report
26
26
  - name: Run codecov
@@ -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.4.7
24
+ rev: v0.6.3
25
25
  hooks:
26
26
  - id: ruff
27
27
  args: ["--fix"]
@@ -36,7 +36,7 @@ repos:
36
36
  args: ["--write"]
37
37
  # Python inside docs
38
38
  - repo: https://github.com/asottile/blacken-docs
39
- rev: 1.16.0
39
+ rev: 1.18.0
40
40
  hooks:
41
41
  - id: blacken-docs
42
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/).
@@ -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.19'
16
- __version_tuple__ = version_tuple = (0, 2, 19)
15
+ __version__ = version = '0.2.20'
16
+ __version_tuple__ = version_tuple = (0, 2, 20)
@@ -5,6 +5,8 @@ import warnings
5
5
 
6
6
  import numpy as np
7
7
 
8
+ from dpdata.utils import open_file
9
+
8
10
  from .scf import (
9
11
  bohr2ang,
10
12
  get_cell,
@@ -156,12 +158,12 @@ def get_frame(fname):
156
158
  path_in = os.path.join(fname, "INPUT")
157
159
  else:
158
160
  raise RuntimeError("invalid input")
159
- with open(path_in) as fp:
161
+ with open_file(path_in) as fp:
160
162
  inlines = fp.read().split("\n")
161
163
  geometry_path_in = get_geometry_in(fname, inlines) # base dir of STRU
162
164
  path_out = get_path_out(fname, inlines)
163
165
 
164
- with open(geometry_path_in) as fp:
166
+ with open_file(geometry_path_in) as fp:
165
167
  geometry_inlines = fp.read().split("\n")
166
168
  celldm, cell = get_cell(geometry_inlines)
167
169
  atom_names, natoms, types, coords = get_coords(
@@ -172,11 +174,11 @@ def get_frame(fname):
172
174
  # ndump = int(os.popen("ls -l %s | grep 'md_pos_' | wc -l" %path_out).readlines()[0])
173
175
  # number of dumped geometry files
174
176
  # coords = get_coords_from_cif(ndump, dump_freq, atom_names, natoms, types, path_out, cell)
175
- with open(os.path.join(path_out, "MD_dump")) as fp:
177
+ with open_file(os.path.join(path_out, "MD_dump")) as fp:
176
178
  dumplines = fp.read().split("\n")
177
179
  coords, cells, force, stress = get_coords_from_dump(dumplines, natoms)
178
180
  ndump = np.shape(coords)[0]
179
- 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:
180
182
  outlines = fp.read().split("\n")
181
183
  energy = get_energy(outlines, ndump, dump_freq)
182
184
 
@@ -4,6 +4,8 @@ import os
4
4
 
5
5
  import numpy as np
6
6
 
7
+ from dpdata.utils import open_file
8
+
7
9
  from .scf import (
8
10
  bohr2ang,
9
11
  collect_force,
@@ -174,10 +176,10 @@ def get_frame(fname):
174
176
  path_in = os.path.join(fname, "INPUT")
175
177
  else:
176
178
  raise RuntimeError("invalid input")
177
- with open(path_in) as fp:
179
+ with open_file(path_in) as fp:
178
180
  inlines = fp.read().split("\n")
179
181
  geometry_path_in = get_geometry_in(fname, inlines) # base dir of STRU
180
- with open(geometry_path_in) as fp:
182
+ with open_file(geometry_path_in) as fp:
181
183
  geometry_inlines = fp.read().split("\n")
182
184
  celldm, cell = get_cell(geometry_inlines)
183
185
  atom_names, natoms, types, coord_tmp = get_coords(
@@ -186,7 +188,7 @@ def get_frame(fname):
186
188
 
187
189
  logf = get_log_file(fname, inlines)
188
190
  assert os.path.isfile(logf), f"Error: can not find {logf}"
189
- with open(logf) as f1:
191
+ with open_file(logf) as f1:
190
192
  lines = f1.readlines()
191
193
 
192
194
  atomnumber = 0
@@ -6,6 +6,8 @@ import warnings
6
6
 
7
7
  import numpy as np
8
8
 
9
+ from dpdata.utils import open_file
10
+
9
11
  from ..unit import EnergyConversion, LengthConversion, PressureConversion
10
12
 
11
13
  bohr2ang = LengthConversion("bohr", "angstrom").value()
@@ -190,7 +192,7 @@ def collect_force(outlines):
190
192
  def get_force(outlines, natoms):
191
193
  force = collect_force(outlines)
192
194
  if len(force) == 0:
193
- return [[]]
195
+ return None
194
196
  else:
195
197
  return np.array(force[-1]) # only return the last force
196
198
 
@@ -253,7 +255,7 @@ def get_frame(fname):
253
255
  if not CheckFile(path_in):
254
256
  return data
255
257
 
256
- with open(path_in) as fp:
258
+ with open_file(path_in) as fp:
257
259
  inlines = fp.read().split("\n")
258
260
 
259
261
  geometry_path_in = get_geometry_in(fname, inlines)
@@ -261,9 +263,9 @@ def get_frame(fname):
261
263
  if not (CheckFile(geometry_path_in) and CheckFile(path_out)):
262
264
  return data
263
265
 
264
- with open(geometry_path_in) as fp:
266
+ with open_file(geometry_path_in) as fp:
265
267
  geometry_inlines = fp.read().split("\n")
266
- with open(path_out) as fp:
268
+ with open_file(path_out) as fp:
267
269
  outlines = fp.read().split("\n")
268
270
 
269
271
  celldm, cell = get_cell(geometry_inlines)
@@ -285,7 +287,7 @@ def get_frame(fname):
285
287
  data["cells"] = cell[np.newaxis, :, :]
286
288
  data["coords"] = coords[np.newaxis, :, :]
287
289
  data["energies"] = np.array(energy)[np.newaxis]
288
- data["forces"] = force[np.newaxis, :, :]
290
+ data["forces"] = np.empty((0,)) if force is None else force[np.newaxis, :, :]
289
291
  if stress is not None:
290
292
  data["virials"] = stress[np.newaxis, :, :]
291
293
  data["orig"] = np.zeros(3)
@@ -338,7 +340,7 @@ def get_nele_from_stru(geometry_inlines):
338
340
 
339
341
  def get_frame_from_stru(fname):
340
342
  assert isinstance(fname, str)
341
- with open(fname) as fp:
343
+ with open_file(fname) as fp:
342
344
  geometry_inlines = fp.read().split("\n")
343
345
  nele = get_nele_from_stru(geometry_inlines)
344
346
  inlines = ["ntype %d" % nele]
@@ -7,6 +7,7 @@ import numpy as np
7
7
 
8
8
  from dpdata.amber.mask import pick_by_amber_mask
9
9
  from dpdata.unit import EnergyConversion
10
+ from dpdata.utils import open_file
10
11
 
11
12
  from ..periodic_table import ELEMENTS
12
13
 
@@ -51,7 +52,7 @@ def read_amber_traj(
51
52
  flag_atom_numb = False
52
53
  amber_types = []
53
54
  atomic_number = []
54
- with open(parm7_file) as f:
55
+ with open_file(parm7_file) as f:
55
56
  for line in f:
56
57
  if line.startswith("%FLAG"):
57
58
  flag_atom_type = line.startswith("%FLAG AMBER_ATOM_TYPE")
@@ -101,14 +102,14 @@ def read_amber_traj(
101
102
  # load energy from mden_file or mdout_file
102
103
  energies = []
103
104
  if mden_file is not None and os.path.isfile(mden_file):
104
- with open(mden_file) as f:
105
+ with open_file(mden_file) as f:
105
106
  for line in f:
106
107
  if line.startswith("L6"):
107
108
  s = line.split()
108
109
  if s[2] != "E_pot":
109
110
  energies.append(float(s[2]))
110
111
  elif mdout_file is not None and os.path.isfile(mdout_file):
111
- with open(mdout_file) as f:
112
+ with open_file(mdout_file) as f:
112
113
  for line in f:
113
114
  if "EPtot" in line:
114
115
  s = line.split()
@@ -1,9 +1,15 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from typing import TYPE_CHECKING
4
+
3
5
  import numpy as np
4
6
 
5
7
  from dpdata.periodic_table import ELEMENTS
6
8
  from dpdata.unit import EnergyConversion
9
+ from dpdata.utils import open_file
10
+
11
+ if TYPE_CHECKING:
12
+ from dpdata.utils import FileType
7
13
 
8
14
  kcal2ev = EnergyConversion("kcal_mol", "eV").value()
9
15
 
@@ -14,7 +20,7 @@ READ_COORDS = 6
14
20
  READ_FORCES = 7
15
21
 
16
22
 
17
- def parse_sqm_out(fname):
23
+ def parse_sqm_out(fname: FileType):
18
24
  """Read atom symbols, charges and coordinates from ambertools sqm.out file."""
19
25
  atom_symbols = []
20
26
  coords = []
@@ -22,7 +28,7 @@ def parse_sqm_out(fname):
22
28
  forces = []
23
29
  energies = []
24
30
 
25
- with open(fname) as f:
31
+ with open_file(fname) as f:
26
32
  flag = START
27
33
  for line in f:
28
34
  if line.startswith(" Total SCF energy"):
@@ -81,7 +87,7 @@ def parse_sqm_out(fname):
81
87
  return data
82
88
 
83
89
 
84
- def make_sqm_in(data, fname=None, frame_idx=0, **kwargs):
90
+ def make_sqm_in(data, fname: FileType | None = None, frame_idx=0, **kwargs):
85
91
  symbols = [data["atom_names"][ii] for ii in data["atom_types"]]
86
92
  atomic_numbers = [ELEMENTS.index(ss) + 1 for ss in symbols]
87
93
  charge = kwargs.get("charge", 0)
@@ -109,6 +115,6 @@ def make_sqm_in(data, fname=None, frame_idx=0, **kwargs):
109
115
  f"{data['coords'][frame_idx][ii, 2]:.6f}",
110
116
  )
111
117
  if fname is not None:
112
- with open(fname, "w") as fp:
118
+ with open_file(fname, "w") as fp:
113
119
  fp.write(ret)
114
120
  return ret