dpgen package

dpgen.info()[source]

Subpackages

Submodules

dpgen.arginfo module

dpgen.arginfo.general_mdata_arginfo(name: str, tasks: tuple[str]) Argument[source]

Generate arginfo for general mdata.

Parameters:
namestr

mdata name

taskstuple[str]

tuple of task keys, e.g. (“train”, “model_devi”, “fp”)

Returns:
Argument

arginfo

dpgen.gui module

DP-GUI entrypoint.

dpgen.gui.start_dpgui(args: Namespace)[source]

Host DP-GUI server.

Parameters:
argsargparse.Namespace

Arguments from argparse.

Raises:
ModuleNotFoundError

The dpgui package is not installed

dpgen.main module

dpgen.main.main()[source]
dpgen.main.main_parser() ArgumentParser[source]

Returns parser for dpgen command.

Returns:
argparse.ArgumentParser

parser for dpgen command

dpgen.util module

dpgen.util.box_center(ch='', fill=' ', sp='|')[source]

Put the string at the center of | |.

dpgen.util.convert_training_data_to_hdf5(input_files: list[str], h5_file: str)[source]

Convert training data to HDF5 format and update the input files.

Parameters:
input_fileslist of str

DeePMD-kit input file names

h5_filestr

HDF5 file name

dpgen.util.expand_sys_str(root_dir: str | Path) list[str][source]

Recursively iterate over directories taking those that contain type.raw file.

If root_dir is a file but not a directory, it will be assumed as an HDF5 file.

Parameters:
root_dirUnion[str, Path]

starting directory

Returns:
List[str]

list of string pointing to system directories

Raises:
RuntimeError

No system was found in the directory

dpgen.util.load_file(filename: str | PathLike) dict[source]

Load data from a JSON or YAML file.

Parameters:
filenamestr or os.PathLike

The filename to load data from, whose suffix should be .json, .yaml, or .yml

Returns:
dict

The data loaded from the file

Raises:
ValueError

If the file format is not supported

dpgen.util.normalize(arginfo: Argument, data: dict, strict_check: bool = True) dict[source]

Normalize and check input data.

Parameters:
arginfodargs.Argument

argument information

datadict

input data

strict_checkbool, default=True

strict check data or not

Returns:
dict

normalized data

dpgen.util.sepline(ch='-', sp='-', screen=False)[source]

Seperate the output by ‘-‘.

dpgen.util.set_directory(path: Path)[source]

Sets the current working path within the context.

Parameters:
pathPath

The path to the cwd

Yields:
None

Examples

>>> with set_directory("some_path"):
...    do_something()
dpgen.util.setup_ele_temp(atomic: bool)[source]

Set electronic temperature as required input data.

Parameters:
atomicbool

Whether to use atomic temperature or frame temperature