fix(lammps): tolerate incomplete and commented dump frames #2496
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test Python import | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.10' | |
| architecture: 'x64' | |
| - run: python -m pip install uv | |
| - run: python -m uv pip install --system . | |
| - name: Test core import and YAML serialization | |
| run: | | |
| python - <<'PY' | |
| import tempfile | |
| from pathlib import Path | |
| import dpdata | |
| system = dpdata.System( | |
| "tests/poscars/POSCAR.h2o.md", fmt="vasp/poscar" | |
| ) | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| filename = Path(tmpdir) / "system.yaml" | |
| system.dump(filename) | |
| loaded = dpdata.System.load(filename) | |
| assert loaded.formula == system.formula | |
| assert loaded.get_nframes() == system.get_nframes() | |
| PY |