Skip to main content

Language Server Protocol and CLI toolkit for DP-GEN input files

Project description

dpgen-lsp

Language Server Protocol implementation for DP-GEN (Deep Potential GENerator) input files.

Features

  • Auto-completion for dpgen JSON input parameters (run, simplify workflows)
  • Diagnostics with error and warning detection (JSON syntax, schema validation, semantic checks)
  • Hover documentation for dpgen parameters from official arginfo documentation
  • Code formatting for consistent JSON structure
  • Support for param.json and machine.json input files

Installation

pip install dpgen-lsp

Usage

Start the language server:

dpgen-lsp

Agent-facing CLI:

dpgen-lsp-tool check param.json
dpgen-lsp-tool complete param.json --line 5 --character 10
dpgen-lsp-tool hover param.json --line 5 --character 10

Editor Integration

This package provides the language server executable. To use it in an editor, connect an LSP client to the dpgen-lsp command and register .json files as dpgen input files.

Supported Workflows

  • dpgen run: param.json with type_map, training, model_devi, fp settings
  • dpgen simplify: param.json with pick_data, iterative selection parameters

Supported FP Engines

  • VASP, Gaussian, CP2K, ABACUS, PWSCF (Quantum ESPRESSO), SIESTA, PWmat, CPX, Amber/Diff, Custom

Example Input File

{
    "type_map": ["H", "C"],
    "mass_map": [1, 12],
    "init_data_sys": ["CH4/deepmd"],
    "sys_configs": [["CH4/scale*/00000*/POSCAR"]],
    "numb_models": 4,
    "default_training_param": {
        "model": {
            "type_map": ["H", "C"],
            "descriptor": {
                "type": "se_a",
                "sel": [16, 4],
                "rcut_smth": 0.5,
                "rcut": 5.0,
                "neuron": [120, 120, 120],
                "resnet_dt": true,
                "axis_neuron": 12,
                "seed": 1
            },
            "fitting_net": {
                "neuron": [25, 50, 100],
                "resnet_dt": false,
                "seed": 1
            }
        },
        "learning_rate": {
            "type": "exp",
            "start_lr": 0.001,
            "decay_steps": 100
        },
        "loss": {
            "start_pref_e": 0.02,
            "limit_pref_e": 2,
            "start_pref_f": 1000,
            "limit_pref_f": 1,
            "start_pref_v": 0.0,
            "limit_pref_v": 0.0
        },
        "training": {
            "numb_steps": 2000,
            "disp_file": "lcurve.out",
            "disp_freq": 1000,
            "save_freq": 1000
        }
    },
    "model_devi_dt": 0.002,
    "model_devi_skip": 0,
    "model_devi_f_trust_lo": 0.05,
    "model_devi_f_trust_hi": 0.15,
    "model_devi_jobs": [
        {
            "sys_idx": [0],
            "temps": [100],
            "press": [1.0],
            "trj_freq": 10,
            "nsteps": 300,
            "ensemble": "nvt"
        }
    ],
    "fp_style": "vasp",
    "fp_task_max": 20,
    "fp_task_min": 5,
    "fp_pp_path": "./",
    "fp_pp_files": ["POTCAR_H", "POTCAR_C"],
    "fp_incar": "./INCAR_methane"
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpgen_lsp-0.1.1.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dpgen_lsp-0.1.1-py3-none-any.whl (84.4 kB view details)

Uploaded Python 3

File details

Details for the file dpgen_lsp-0.1.1.tar.gz.

File metadata

  • Download URL: dpgen_lsp-0.1.1.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for dpgen_lsp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9a4cdb737d64e374bbed7108089a7c119717f8b68345a6f01cd584fb724a3b94
MD5 5fbaaaac70fd93632a097a693424e4e6
BLAKE2b-256 6325aee67ab7d11cf1003a7d24986f0b49d798a54090fb763f25ac2825f332c2

See more details on using hashes here.

File details

Details for the file dpgen_lsp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dpgen_lsp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 84.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for dpgen_lsp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eecd6c259a9f17d558316a9dbdee5bb80a93812f215d73645d8525a55428afd7
MD5 f856b0d1ce0372b6eabb01c38cb06f8d
BLAKE2b-256 0156402014e344df803705390506a06efe08626b63379869a9cc743894822258

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page