dpdata 0.2.25__tar.gz → 1.0.1__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.
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/dependabot.yml +0 -1
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/benchmark.yml +6 -4
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/pyright.yml +3 -3
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/test.yml +10 -6
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/test_import.yml +2 -2
- {dpdata-0.2.25 → dpdata-1.0.1}/.gitignore +5 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.pre-commit-config.yaml +16 -8
- dpdata-1.0.1/AGENTS.md +165 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/PKG-INFO +10 -1
- {dpdata-0.2.25 → dpdata-1.0.1}/README.md +7 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/_version.py +16 -3
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/abacus/scf.py +8 -3
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/cp2k/output.py +1 -1
- dpdata-1.0.1/dpdata/deepmd/mixed.py +299 -0
- dpdata-1.0.1/dpdata/gaussian/fchk.py +175 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/lammps/dump.py +56 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/lammps/lmp.py +277 -16
- dpdata-1.0.1/dpdata/lmdb/__init__.py +5 -0
- dpdata-1.0.1/dpdata/lmdb/format.py +286 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/deepmd.py +24 -2
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/gaussian.py +31 -0
- dpdata-1.0.1/dpdata/plugins/lammps.py +193 -0
- dpdata-1.0.1/dpdata/plugins/lmdb.py +6 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/vasp.py +8 -2
- dpdata-1.0.1/dpdata/plugins/xyz.py +116 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/qe/traj.py +27 -1
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/system.py +8 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/unit.py +28 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/vasp/outcar.py +19 -2
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/vasp/xml.py +57 -7
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/xyz/quip_gap_xyz.py +65 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/PKG-INFO +10 -1
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/SOURCES.txt +8 -1
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/requires.txt +2 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/pyproject.toml +2 -0
- dpdata-1.0.1/skills/dpdata-cli/README.md +71 -0
- dpdata-1.0.1/skills/dpdata-cli/SKILL.md +188 -0
- dpdata-0.2.25/dpdata/deepmd/mixed.py +0 -157
- dpdata-0.2.25/dpdata/plugins/lammps.py +0 -101
- dpdata-0.2.25/dpdata/plugins/xyz.py +0 -58
- {dpdata-0.2.25 → dpdata-1.0.1}/.git-blame-ignore-revs +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.git_archival.txt +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.gitattributes +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/ISSUE_TEMPLATE/generic-issue.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/mirror_gitee.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.github/workflows/pub-pypi.yml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/.readthedocs.yaml +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/LICENSE +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/MANIFEST.in +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/benchmark/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/benchmark/test_import.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/__about__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/__main__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/abacus/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/abacus/md.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/abacus/relax.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/abacus/stru.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/amber/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/amber/mask.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/amber/md.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/amber/sqm.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/ase_calculator.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/bond_order_system.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/cli.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/cp2k/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/cp2k/cell.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/data_type.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/deepmd/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/deepmd/comp.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/deepmd/hdf5.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/deepmd/raw.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/dftbplus/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/dftbplus/output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/driver.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/fhi_aims/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/fhi_aims/output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/format.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/gaussian/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/gaussian/gjf.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/gaussian/log.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/gromacs/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/gromacs/gro.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/lammps/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/md/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/md/msd.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/md/pbc.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/md/rdf.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/md/water.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/openmx/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/openmx/omx.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/orca/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/orca/output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/periodic_table.json +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/periodic_table.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugin.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/3dmol.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/abacus.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/amber.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/ase.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/cp2k.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/dftbplus.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/fhi_aims.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/gromacs.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/list.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/n2p2.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/openmx.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/orca.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/psi4.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/pwmat.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/pymatgen.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/qe.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/rdkit.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/plugins/siesta.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/psi4/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/psi4/input.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/psi4/output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pwmat/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pwmat/atomconfig.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pwmat/movement.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/py.typed +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pymatgen/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pymatgen/molecule.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/pymatgen/structure.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/qe/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/qe/scf.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/rdkit/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/rdkit/sanitize.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/rdkit/utils.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/siesta/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/siesta/aiMD_output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/siesta/output.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/stat.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/utils.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/vasp/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/vasp/poscar.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/xyz/__init__.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata/xyz/xyz.py +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/dependency_links.txt +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/entry_points.txt +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/dpdata.egg-info/top_level.txt +0 -0
- {dpdata-0.2.25 → dpdata-1.0.1}/setup.cfg +0 -0
|
@@ -6,14 +6,15 @@ on:
|
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
benchmark:
|
|
9
|
+
if: ${{ github.repository_owner == 'deepmodeling' }}
|
|
9
10
|
runs-on: ubuntu-latest
|
|
10
11
|
steps:
|
|
11
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v6
|
|
12
13
|
- name: Set up Python
|
|
13
|
-
uses: actions/setup-python@
|
|
14
|
+
uses: actions/setup-python@v6
|
|
14
15
|
with:
|
|
15
16
|
python-version: 3.12
|
|
16
|
-
- uses: astral-sh/setup-uv@
|
|
17
|
+
- uses: astral-sh/setup-uv@v7
|
|
17
18
|
with:
|
|
18
19
|
enable-cache: true
|
|
19
20
|
cache-dependency-glob: |
|
|
@@ -22,7 +23,8 @@ jobs:
|
|
|
22
23
|
- name: Install dependencies
|
|
23
24
|
run: uv pip install --system .[test,amber,ase,pymatgen,benchmark] rdkit openbabel-wheel
|
|
24
25
|
- name: Run benchmarks
|
|
25
|
-
uses: CodSpeedHQ/action@
|
|
26
|
+
uses: CodSpeedHQ/action@v4
|
|
26
27
|
with:
|
|
27
28
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
|
29
|
+
mode: walltime
|
|
28
30
|
run: pytest benchmark/ --codspeed
|
|
@@ -9,11 +9,11 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@master
|
|
12
|
-
- uses: actions/setup-python@
|
|
12
|
+
- uses: actions/setup-python@v6
|
|
13
13
|
with:
|
|
14
14
|
python-version: '3.12'
|
|
15
15
|
- run: pip install uv
|
|
16
|
-
- run: uv pip install --system -e .[amber,ase,pymatgen]
|
|
17
|
-
- uses: jakebailey/pyright-action@
|
|
16
|
+
- run: uv pip install --system -e .[amber,ase,pymatgen] rdkit openbabel-wheel
|
|
17
|
+
- uses: jakebailey/pyright-action@v3
|
|
18
18
|
with:
|
|
19
19
|
version: 1.1.363
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
name: Python package
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
- push
|
|
5
|
+
- pull_request
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
build:
|
|
@@ -12,13 +12,13 @@ jobs:
|
|
|
12
12
|
python-version: ["3.8", "3.12"]
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
16
|
# set up conda
|
|
17
17
|
- name: Set up Python ${{ matrix.python-version }}
|
|
18
|
-
uses: actions/setup-python@
|
|
18
|
+
uses: actions/setup-python@v6
|
|
19
19
|
with:
|
|
20
20
|
python-version: ${{ matrix.python-version }}
|
|
21
|
-
- uses: astral-sh/setup-uv@
|
|
21
|
+
- uses: astral-sh/setup-uv@v7
|
|
22
22
|
with:
|
|
23
23
|
enable-cache: true
|
|
24
24
|
cache-dependency-glob: |
|
|
@@ -26,13 +26,15 @@ jobs:
|
|
|
26
26
|
**/pyproject.toml
|
|
27
27
|
cache-suffix: "py${{ matrix.python-version }}"
|
|
28
28
|
- name: Install dependencies
|
|
29
|
-
run: uv pip install --system .[test,amber,ase,pymatgen] coverage ./tests/plugin
|
|
29
|
+
run: uv pip install --system .[test,amber,ase,pymatgen] coverage ./tests/plugin rdkit openbabel-wheel
|
|
30
30
|
- name: Test
|
|
31
31
|
run: cd tests && coverage run --source=../dpdata -m unittest && cd .. && coverage combine tests/.coverage && coverage report
|
|
32
32
|
- name: Run codecov
|
|
33
33
|
uses: codecov/codecov-action@v5
|
|
34
34
|
env:
|
|
35
35
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
36
|
+
with:
|
|
37
|
+
use_oidc: true
|
|
36
38
|
pass:
|
|
37
39
|
needs: [build]
|
|
38
40
|
runs-on: ubuntu-latest
|
|
@@ -42,3 +44,5 @@ jobs:
|
|
|
42
44
|
uses: re-actors/alls-green@release/v1
|
|
43
45
|
with:
|
|
44
46
|
jobs: ${{ toJSON(needs) }}
|
|
47
|
+
permissions:
|
|
48
|
+
id-token: write
|
|
@@ -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:
|
|
5
|
+
rev: v6.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
# there are many log files in tests
|
|
8
8
|
# TODO: seperate py files and log files
|
|
@@ -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.
|
|
24
|
+
rev: v0.15.2
|
|
25
25
|
hooks:
|
|
26
26
|
- id: ruff
|
|
27
27
|
args: ["--fix"]
|
|
@@ -34,10 +34,18 @@ repos:
|
|
|
34
34
|
hooks:
|
|
35
35
|
- id: velin
|
|
36
36
|
args: ["--write"]
|
|
37
|
-
#
|
|
38
|
-
- repo: https://github.com/
|
|
39
|
-
rev: 1.
|
|
37
|
+
# markdown
|
|
38
|
+
- repo: https://github.com/hukkin/mdformat
|
|
39
|
+
rev: 1.0.0
|
|
40
40
|
hooks:
|
|
41
|
-
- id:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
- id: mdformat
|
|
42
|
+
exclude: "^tests/.*$"
|
|
43
|
+
additional_dependencies:
|
|
44
|
+
# - mdformat-myst==0.3.0
|
|
45
|
+
# See https://github.com/executablebooks/mdformat-myst/issues/13
|
|
46
|
+
- "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
|
|
47
|
+
- mdformat-ruff==0.1.3
|
|
48
|
+
- mdformat-web==0.2.0
|
|
49
|
+
- mdformat-config==0.2.1
|
|
50
|
+
- mdformat-beautysh==1.0.0
|
|
51
|
+
- mdformat-gfm-alerts==2.0.0
|
dpdata-1.0.1/AGENTS.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# dpdata - Atomistic Data Format Manipulation
|
|
2
|
+
|
|
3
|
+
dpdata is a Python package for manipulating atomistic data from computational science software. It supports format conversion between various atomistic simulation packages including VASP, DeePMD-kit, LAMMPS, GROMACS, Gaussian, ABACUS, and many others.
|
|
4
|
+
|
|
5
|
+
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
|
|
6
|
+
|
|
7
|
+
## Working Effectively
|
|
8
|
+
|
|
9
|
+
- **Bootstrap and install the repository:**
|
|
10
|
+
|
|
11
|
+
- `cd /home/runner/work/dpdata/dpdata` (or wherever the repo is cloned)
|
|
12
|
+
- `uv pip install -e .` -- installs dpdata in development mode with core dependencies (numpy, scipy, h5py, monty, wcmatch)
|
|
13
|
+
- Test installation: `dpdata --version` -- should show version like "dpdata v0.1.dev2+..."
|
|
14
|
+
|
|
15
|
+
- **Run tests:**
|
|
16
|
+
|
|
17
|
+
- `cd tests && python -m unittest discover` -- runs all 1826 tests in ~10 seconds. NEVER CANCEL.
|
|
18
|
+
- `cd tests && python -m unittest test_<module>.py` -- run specific test modules (individual modules take ~0.5 seconds)
|
|
19
|
+
- `cd tests && coverage run --source=../dpdata -m unittest discover && coverage report` -- run tests with coverage
|
|
20
|
+
|
|
21
|
+
- **Linting and formatting:**
|
|
22
|
+
|
|
23
|
+
- Install ruff: `uv pip install ruff`
|
|
24
|
+
- `ruff check dpdata/` -- lint the main package (takes ~1 second)
|
|
25
|
+
- `ruff format dpdata/` -- format code according to project style
|
|
26
|
+
- `ruff check --fix dpdata/` -- auto-fix linting issues where possible
|
|
27
|
+
|
|
28
|
+
- **Pre-commit hooks:**
|
|
29
|
+
|
|
30
|
+
- Install: `uv pip install pre-commit`
|
|
31
|
+
- `pre-commit run --all-files` -- run all hooks on all files
|
|
32
|
+
- Hooks include: ruff linting/formatting, trailing whitespace, end-of-file-fixer, yaml/json/toml checks
|
|
33
|
+
|
|
34
|
+
## Validation
|
|
35
|
+
|
|
36
|
+
- **Always test CLI functionality after making changes:**
|
|
37
|
+
|
|
38
|
+
- `dpdata --help` -- ensure CLI still works
|
|
39
|
+
- `dpdata --version` -- verify version is correct
|
|
40
|
+
- Test a basic conversion if sample data is available
|
|
41
|
+
|
|
42
|
+
- **Always run linting before committing:**
|
|
43
|
+
|
|
44
|
+
- `ruff check dpdata/` -- ensure no new linting errors
|
|
45
|
+
- `ruff format dpdata/` -- ensure code is properly formatted
|
|
46
|
+
|
|
47
|
+
- **Run relevant tests for your changes:**
|
|
48
|
+
|
|
49
|
+
- For format-specific changes: `cd tests && python -m unittest test_<format>*.py`
|
|
50
|
+
- For core system changes: `cd tests && python -m unittest test_system*.py test_multisystems.py`
|
|
51
|
+
- For CLI changes: `cd tests && python -m unittest test_cli.py` (if exists)
|
|
52
|
+
|
|
53
|
+
## Build and Documentation
|
|
54
|
+
|
|
55
|
+
- **Documentation:**
|
|
56
|
+
|
|
57
|
+
- `cd docs && make help` -- see all available build targets
|
|
58
|
+
- `cd docs && make html` -- build HTML documentation (requires additional dependencies)
|
|
59
|
+
- Documentation source is in `docs/` directory using Sphinx
|
|
60
|
+
- **NOTE:** Full docs build requires additional dependencies like `deepmodeling-sphinx` that may not be readily available
|
|
61
|
+
|
|
62
|
+
- **Package building:**
|
|
63
|
+
|
|
64
|
+
- Uses setuptools with pyproject.toml configuration
|
|
65
|
+
- `uv pip install build && python -m build` -- create source and wheel distributions
|
|
66
|
+
- Version is managed by setuptools_scm from git tags
|
|
67
|
+
|
|
68
|
+
## Common Tasks
|
|
69
|
+
|
|
70
|
+
The following are outputs from frequently run commands. Reference them instead of re-running to save time.
|
|
71
|
+
|
|
72
|
+
### Repository structure
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
/home/runner/work/dpdata/dpdata/
|
|
76
|
+
├── dpdata/ # Main package code
|
|
77
|
+
│ ├── __init__.py
|
|
78
|
+
│ ├── cli.py # Command-line interface
|
|
79
|
+
│ ├── system.py # Core System classes
|
|
80
|
+
│ ├── format.py # Format registry
|
|
81
|
+
│ ├── abacus/ # ABACUS format support
|
|
82
|
+
│ ├── amber/ # AMBER format support
|
|
83
|
+
│ ├── deepmd/ # DeePMD format support
|
|
84
|
+
│ ├── vasp/ # VASP format support
|
|
85
|
+
│ ├── xyz/ # XYZ format support
|
|
86
|
+
│ └── ... # Other format modules
|
|
87
|
+
├── tests/ # Test suite (91 test files)
|
|
88
|
+
├── docs/ # Sphinx documentation
|
|
89
|
+
├── plugin_example/ # Example plugin
|
|
90
|
+
├── pyproject.toml # Project configuration
|
|
91
|
+
└── README.md
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Key dependencies
|
|
95
|
+
|
|
96
|
+
- Core: numpy>=1.14.3, scipy, h5py, monty, wcmatch
|
|
97
|
+
- Optional: ase (ASE integration), parmed (AMBER), pymatgen (Materials Project), rdkit (molecular analysis)
|
|
98
|
+
- Testing: unittest (built-in), coverage
|
|
99
|
+
- Linting: ruff
|
|
100
|
+
- Docs: sphinx with various extensions
|
|
101
|
+
|
|
102
|
+
### Test timing expectations
|
|
103
|
+
|
|
104
|
+
- Full test suite: ~10 seconds (1826 tests). NEVER CANCEL.
|
|
105
|
+
- Individual test modules: ~0.5 seconds
|
|
106
|
+
- Linting with ruff: ~1 second
|
|
107
|
+
- Documentation build: ~30 seconds
|
|
108
|
+
|
|
109
|
+
### Common workflows
|
|
110
|
+
|
|
111
|
+
1. **Adding a new format:**
|
|
112
|
+
|
|
113
|
+
- Create module in `dpdata/<format>/`
|
|
114
|
+
- Implement format classes inheriting from appropriate base classes
|
|
115
|
+
- Add tests in `tests/test_<format>*.py`
|
|
116
|
+
- Register format in the plugin system
|
|
117
|
+
|
|
118
|
+
1. **Fixing bugs:**
|
|
119
|
+
|
|
120
|
+
- Write test that reproduces the bug first
|
|
121
|
+
- Make minimal fix to pass the test
|
|
122
|
+
- Run full test suite to ensure no regressions
|
|
123
|
+
- Run linting to ensure code style compliance
|
|
124
|
+
|
|
125
|
+
1. **CLI changes:**
|
|
126
|
+
|
|
127
|
+
- Modify `dpdata/cli.py`
|
|
128
|
+
- Test with `dpdata --help` and specific commands
|
|
129
|
+
- Add/update tests if needed
|
|
130
|
+
|
|
131
|
+
## Troubleshooting
|
|
132
|
+
|
|
133
|
+
- **Installation timeouts:** Network timeouts during `uv pip install` are common. If this occurs, try:
|
|
134
|
+
|
|
135
|
+
- Individual package installation: `uv pip install numpy scipy h5py monty wcmatch`
|
|
136
|
+
- Use `--timeout` option: `uv pip install --timeout 300 -e .`
|
|
137
|
+
- Verify existing installation works: `dpdata --version` should work even if reinstall fails
|
|
138
|
+
|
|
139
|
+
- **Optional dependency errors:** Many tests will skip or fail if optional dependencies (ase, parmed, pymatgen, rdkit) are not installed. This is expected. Core functionality will work with just the basic dependencies.
|
|
140
|
+
|
|
141
|
+
- **Documentation build failures:** The docs build requires specific dependencies like `deepmodeling-sphinx` that may not be readily available. Use `make help` to see available targets, but expect build failures without full doc dependencies.
|
|
142
|
+
|
|
143
|
+
- **Test artifacts:** The test suite generates temporary files (`tests/data_*`, `tests/tmp.*`, `tests/.coverage`). These are excluded by `.gitignore` and should not be committed.
|
|
144
|
+
|
|
145
|
+
- **Import errors:** If you see import errors for specific modules, check if the corresponding optional dependency is installed. For example, ASE functionality requires `uv pip install ase`.
|
|
146
|
+
|
|
147
|
+
## Critical Notes
|
|
148
|
+
|
|
149
|
+
- **NEVER CANCEL** test runs or builds - they complete quickly (10 seconds for tests, 30 seconds for docs)
|
|
150
|
+
- Always run `ruff check` and `ruff format` before committing
|
|
151
|
+
- Test artifacts in `tests/` directory are excluded by `.gitignore` - don't commit them
|
|
152
|
+
- Optional dependencies are required for some formats but core functionality works without them
|
|
153
|
+
- The CLI tool `dpdata` is the main user interface for format conversion
|
|
154
|
+
|
|
155
|
+
## Commit and PR Guidelines
|
|
156
|
+
|
|
157
|
+
- **Use semantic commit messages** for all commits and PR titles following the format: `type(scope): description`
|
|
158
|
+
- **Types:** `feat` (new feature), `fix` (bug fix), `docs` (documentation), `style` (formatting), `refactor` (code restructuring), `test` (testing), `chore` (maintenance)
|
|
159
|
+
- **Examples:**
|
|
160
|
+
- `feat(vasp): add support for POSCAR format`
|
|
161
|
+
- `fix(cli): resolve parsing error for multi-frame files`
|
|
162
|
+
- `docs: update installation instructions`
|
|
163
|
+
- `test(amber): add tests for trajectory parsing`
|
|
164
|
+
- **PR titles** must follow semantic commit format
|
|
165
|
+
- **Commit messages** should be concise but descriptive of the actual changes made
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dpdata
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
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>
|
|
@@ -187,6 +187,8 @@ Requires-Dist: monty
|
|
|
187
187
|
Requires-Dist: scipy
|
|
188
188
|
Requires-Dist: h5py
|
|
189
189
|
Requires-Dist: wcmatch
|
|
190
|
+
Requires-Dist: lmdb
|
|
191
|
+
Requires-Dist: msgpack-numpy
|
|
190
192
|
Requires-Dist: importlib_metadata>=1.4; python_version < "3.8"
|
|
191
193
|
Requires-Dist: typing_extensions; python_version < "3.8"
|
|
192
194
|
Provides-Extra: test
|
|
@@ -215,12 +217,19 @@ Dynamic: license-file
|
|
|
215
217
|
|
|
216
218
|
# dpdata
|
|
217
219
|
|
|
220
|
+
[](https://doi.org/10.1021/acs.jcim.5c01767)
|
|
218
221
|
[](https://anaconda.org/conda-forge/dpdata)
|
|
219
222
|
[](https://pypi.org/project/dpdata)
|
|
220
223
|
[](https://dpdata.readthedocs.io/)
|
|
221
224
|
|
|
222
225
|
**dpdata** is a Python package for manipulating atomistic data of software in computational science.
|
|
223
226
|
|
|
227
|
+
## Credits
|
|
228
|
+
|
|
229
|
+
If you use this software, please cite the following paper:
|
|
230
|
+
|
|
231
|
+
- Jinzhe Zeng, Xingliang Peng, Yong-Bin Zhuang, Haidi Wang, Fengbo Yuan, Duo Zhang, Renxi Liu, Yingze Wang, Ping Tuo, Yuzhi Zhang, Yixiao Chen, Yifan Li, Cao Thang Nguyen, Jiameng Huang, Anyang Peng, Marián Rynik, Wei-Hong Xu, Zezhong Zhang, Xu-Yuan Zhou, Tao Chen, Jiahao Fan, Wanrun Jiang, Bowen Li, Denan Li, Haoxi Li, Wenshuo Liang, Ruihao Liao, Liping Liu, Chenxing Luo, Logan Ward, Kaiwei Wan, Junjie Wang, Pan Xiang, Chengqian Zhang, Jinchao Zhang, Rui Zhou, Jia-Xin Zhu, Linfeng Zhang, Han Wang, dpdata: A Scalable Python Toolkit for Atomistic Machine Learning Data Sets, *J. Chem. Inf. Model.*, 2025, DOI: [10.1021/acs.jcim.5c01767](https://doi.org/10.1021/acs.jcim.5c01767). [](https://badge.dimensions.ai/details/doi/10.1021/acs.jcim.5c01767)
|
|
232
|
+
|
|
224
233
|
## Installation
|
|
225
234
|
|
|
226
235
|
dpdata only supports Python 3.8 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 dpdata:
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# dpdata
|
|
2
2
|
|
|
3
|
+
[](https://doi.org/10.1021/acs.jcim.5c01767)
|
|
3
4
|
[](https://anaconda.org/conda-forge/dpdata)
|
|
4
5
|
[](https://pypi.org/project/dpdata)
|
|
5
6
|
[](https://dpdata.readthedocs.io/)
|
|
6
7
|
|
|
7
8
|
**dpdata** is a Python package for manipulating atomistic data of software in computational science.
|
|
8
9
|
|
|
10
|
+
## Credits
|
|
11
|
+
|
|
12
|
+
If you use this software, please cite the following paper:
|
|
13
|
+
|
|
14
|
+
- Jinzhe Zeng, Xingliang Peng, Yong-Bin Zhuang, Haidi Wang, Fengbo Yuan, Duo Zhang, Renxi Liu, Yingze Wang, Ping Tuo, Yuzhi Zhang, Yixiao Chen, Yifan Li, Cao Thang Nguyen, Jiameng Huang, Anyang Peng, Marián Rynik, Wei-Hong Xu, Zezhong Zhang, Xu-Yuan Zhou, Tao Chen, Jiahao Fan, Wanrun Jiang, Bowen Li, Denan Li, Haoxi Li, Wenshuo Liang, Ruihao Liao, Liping Liu, Chenxing Luo, Logan Ward, Kaiwei Wan, Junjie Wang, Pan Xiang, Chengqian Zhang, Jinchao Zhang, Rui Zhou, Jia-Xin Zhu, Linfeng Zhang, Han Wang, dpdata: A Scalable Python Toolkit for Atomistic Machine Learning Data Sets, *J. Chem. Inf. Model.*, 2025, DOI: [10.1021/acs.jcim.5c01767](https://doi.org/10.1021/acs.jcim.5c01767). [](https://badge.dimensions.ai/details/doi/10.1021/acs.jcim.5c01767)
|
|
15
|
+
|
|
9
16
|
## Installation
|
|
10
17
|
|
|
11
18
|
dpdata only supports Python 3.8 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 dpdata:
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '0.
|
|
21
|
-
__version_tuple__ = version_tuple = (
|
|
31
|
+
__version__ = version = '1.0.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 0, 1)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'gae134fe29'
|
|
@@ -45,7 +45,10 @@ def get_path_out(fname, inlines):
|
|
|
45
45
|
def get_energy(outlines):
|
|
46
46
|
Etot = None
|
|
47
47
|
for line in reversed(outlines):
|
|
48
|
-
if "final etot is" in line:
|
|
48
|
+
if "final etot is" in line: # for LTS
|
|
49
|
+
Etot = float(line.split()[-2]) # in eV
|
|
50
|
+
return Etot, True
|
|
51
|
+
elif "TOTAL ENERGY" in line: # for develop
|
|
49
52
|
Etot = float(line.split()[-2]) # in eV
|
|
50
53
|
return Etot, True
|
|
51
54
|
elif "convergence has NOT been achieved!" in line:
|
|
@@ -59,7 +62,8 @@ def get_energy(outlines):
|
|
|
59
62
|
def collect_force(outlines):
|
|
60
63
|
force = []
|
|
61
64
|
for i, line in enumerate(outlines):
|
|
62
|
-
if "TOTAL-FORCE (eV/Angstrom)" in line:
|
|
65
|
+
# if "TOTAL-FORCE (eV/Angstrom)" in line:
|
|
66
|
+
if "TOTAL-FORCE" in line:
|
|
63
67
|
value_pattern = re.compile(
|
|
64
68
|
r"^\s*[A-Z][a-z]?[1-9][0-9]*\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$"
|
|
65
69
|
)
|
|
@@ -95,7 +99,8 @@ def get_force(outlines, natoms):
|
|
|
95
99
|
def collect_stress(outlines):
|
|
96
100
|
stress = []
|
|
97
101
|
for i, line in enumerate(outlines):
|
|
98
|
-
if "TOTAL-STRESS (KBAR)" in line:
|
|
102
|
+
# if "TOTAL-STRESS (KBAR)" in line:
|
|
103
|
+
if "TOTAL-STRESS" in line:
|
|
99
104
|
value_pattern = re.compile(
|
|
100
105
|
r"^\s*[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s+[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\s*$"
|
|
101
106
|
)
|
|
@@ -65,7 +65,7 @@ class Cp2kSystems:
|
|
|
65
65
|
# assert all(eq2), (log_info_dict,xyz_info_dict,'There may be errors in the file. If it is a restart task; use restart=True')
|
|
66
66
|
# assert all(eq3), (log_info_dict,xyz_info_dict,'There may be errors in the file. If it is a restart task; use restart=True')
|
|
67
67
|
assert math.isclose(
|
|
68
|
-
log_info_dict["energies"], xyz_info_dict["energies"], abs_tol=1.0e-6
|
|
68
|
+
log_info_dict["energies"][0], xyz_info_dict["energies"][0], abs_tol=1.0e-6
|
|
69
69
|
), (
|
|
70
70
|
log_info_dict["energies"],
|
|
71
71
|
xyz_info_dict["energies"],
|