{"id":26911,"library":"dpdata","title":"dpdata","description":"A Python library for manipulating data formats of DeePMD-kit, VASP, QE, PWmat, LAMMPS, ABACUS, and other computational chemistry/DFT codes. It provides a unified interface to read, write, convert, and process atomic simulation data including coordinates, forces, energies, and stress tensors. Current version: 1.0.1, with a stable API after the 1.0.0 release. Release cadence: approximately 1-2 months per minor/patch version.","status":"active","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/deepmodeling/dpdata","tags":["computational-chemistry","DFT","molecular-dynamics","DeePMD","VASP","LAMMPS","ABACUS","data-conversion"],"install":[{"cmd":"pip install dpdata","lang":"bash","label":"default install"}],"dependencies":[{"reason":"core array operations","package":"numpy","optional":false},{"reason":"ASE Atoms and Trajectory support, converting dpdata System to/from ASE","package":"ase","optional":true}],"imports":[{"note":"dpdata previously allowed deep imports, but requires top-level import since v0.2.20","wrong":"from dpdata.system import System","symbol":"System","correct":"from dpdata import System"},{"note":"similar to System, top-level import is recommended","wrong":"from dpdata.multisystems import MultiSystems","symbol":"MultiSystems","correct":"from dpdata import MultiSystems"}],"quickstart":{"code":"from dpdata import System\nimport numpy as np\n\nsys = System('path/to/OUTCAR', fmt='vasp/outcar')\nprint('Number of atoms per frame:', sys['atom_numbs'])\nprint('First frame energies:', sys['energies'][0])\n# Convert ASE Atoms back\natoms = sys.to_ase_atoms()\nprint(atoms)","lang":"python","description":"Read a VASP OUTCAR file, print number of atoms and first frame energy, convert to ASE Atoms."},"warnings":[{"fix":"Access sys.atom_type_map to get mapping from index to species name.","message":"dpdata uses 0-based atomic type indices, while some formats (e.g., LAMMPS) use 1-based. Always check atom_type_map after loading.","severity":"gotcha","affected_versions":"all"},{"fix":"Specify set_size in the DeepmdNativeFormat or use to_deepmd_npy(set_size=...) to control splitting.","message":"When converting to deepmd/npy, the 'set_size' during writing can produce multiple subdirectories (set.001, set.002, ...). Ensure consistency in number of frames per set if you intend to use multiple sets for training.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Python to 3.8 or later.","message":"Python 3.7 support was dropped in v0.2.22. Python 3.8+ is required.","severity":"breaking","affected_versions":">=0.2.22"},{"fix":"Use set_size instead of label.","message":"The 'label' kwarg in to_deepmd_npy is deprecated in favor of 'set_size'.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Before writing, assign sys.data['atom_mass'] = [...] or use sys.set_masses(mass_map).","message":"Writing to LAMMPS data file may lose information if the System contains multiple atom types with different masses; you must manually set mass_map.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install dpdata","cause":"dpdata is not installed.","error":"ModuleNotFoundError: No module named 'dpdata'"},{"fix":"Use: from dpdata import System","cause":"Importing dpdata but not using submodule; may have old version or incorrect import.","error":"AttributeError: module 'dpdata' has no attribute 'System'"},{"fix":"Use fmt='vasp/outcar' when reading VASP OUTCAR files.","cause":"Format string mismatch: dpdata expects 'vasp/outcar' not just 'outcar'.","error":"ValueError: Unknown format: 'outcar'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}