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.0.1.tar.gz (39.1 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.0.1-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dpgen_lsp-0.0.1.tar.gz
  • Upload date:
  • Size: 39.1 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.0.1.tar.gz
Algorithm Hash digest
SHA256 7402b7db97f2376deb8eb9c54f87169b52c1e80a1f862cfcc7c70fd9b3767835
MD5 64dd38e45ea7ac687305450aa733a3fd
BLAKE2b-256 a2d88df67ec71ea769872a42dc91b151f5f8d6eb5350fef19887e817b65e84df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dpgen_lsp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 52.6 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61e2727563b2610343e13427b94db126a1c7ed5cae1ac0c2f8624d5a0d94c024
MD5 0f7e4a6c415f196122ec63540625729c
BLAKE2b-256 cef69fdc5e1451b13144905663f56356288e5283bae5574cc16aefa4194f419f

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