dpgen2.fp package
Submodules
dpgen2.fp.deepmd module
Prep and Run Gaussian tasks.
- class dpgen2.fp.deepmd.PrepDeepmd(*args, **kwargs)[source]
Bases:
PrepFp
- Attributes:
- key
- workflow_name
Methods
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
prep_task
(conf_frame, inputs)Define how one Deepmd task is prepared.
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- class dpgen2.fp.deepmd.RunDeepmd(*args, **kwargs)[source]
Bases:
RunFp
- Attributes:
- key
- workflow_name
Methods
args
()The argument definition of the run_task method.
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
The mandatory input files to run a Deepmd task.
normalize_config
([data, strict])Normalized the argument.
The optional input files to run a Deepmd task.
run_task
(teacher_model_path, out, log)Defines how one FP task runs
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- static args() List[Argument] [source]
The argument definition of the run_task method.
- Returns:
- arguments: List[dargs.Argument]
List of dargs.Argument defines the arguments of run_task method.
- input_files() List[str] [source]
The mandatory input files to run a Deepmd task.
- Returns:
- files: List[str]
A list of madatory input files names.
- optional_input_files() List[str] [source]
The optional input files to run a Deepmd task.
- Returns:
- files: List[str]
A list of optional input files names.
- run_task(teacher_model_path: BinaryFileInput, out: str, log: str) Tuple[str, str] [source]
Defines how one FP task runs
- Parameters:
- commandstr
The command of running Deepmd task
- outstr
The name of the output data file.
- Returns:
- out_name: str
The file name of the output data in the dpdata.LabeledSystem format.
- log_name: str
The file name of the log.
dpgen2.fp.gaussian module
Prep and Run Gaussian tasks.
- class dpgen2.fp.gaussian.GaussianInputs(**kwargs: Any)[source]
Bases:
object
Methods
args
()The arguments of the GaussianInputs class.
- class dpgen2.fp.gaussian.PrepGaussian(*args, **kwargs)[source]
Bases:
PrepFp
- Attributes:
- key
- workflow_name
Methods
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
prep_task
(conf_frame, inputs)Define how one Gaussian task is prepared.
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- prep_task(conf_frame: System, inputs: GaussianInputs)[source]
Define how one Gaussian task is prepared.
- Parameters:
- conf_framedpdata.System
One frame of configuration in the dpdata format.
- inputsGaussianInputs
The GaussianInputs object handels all other input files of the task.
- class dpgen2.fp.gaussian.RunGaussian(*args, **kwargs)[source]
Bases:
RunFp
- Attributes:
- key
- workflow_name
Methods
args
()The argument definition of the run_task method.
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
The mandatory input files to run a Gaussian task.
normalize_config
([data, strict])Normalized the argument.
The optional input files to run a Gaussian task.
run_task
(command, out)Defines how one FP task runs
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- static args() List[Argument] [source]
The argument definition of the run_task method.
- Returns:
- arguments: List[dargs.Argument]
List of dargs.Argument defines the arguments of run_task method.
- input_files() List[str] [source]
The mandatory input files to run a Gaussian task.
- Returns:
- files: List[str]
A list of madatory input files names.
- optional_input_files() List[str] [source]
The optional input files to run a Gaussian task.
- Returns:
- files: List[str]
A list of optional input files names.
- run_task(command: str, out: str) Tuple[str, str] [source]
Defines how one FP task runs
- Parameters:
- commandstr
The command of running gaussian task
- outstr
The name of the output data file.
- Returns:
- out_name: str
The file name of the output data in the dpdata.LabeledSystem format.
- log_name: str
The file name of the log.
dpgen2.fp.prep_fp module
- class dpgen2.fp.prep_fp.PrepFp(*args, **kwargs)[source]
-
Prepares the working directories for first-principles (FP) tasks.
A list of (same length as ip[“confs”]) working directories containing all files needed to start FP tasks will be created. The paths of the directories will be returned as op[“task_paths”]. The identities of the tasks are returned as op[“task_names”].
- Attributes:
- key
- workflow_name
Methods
execute
(ip)Execute the OP.
Get the signature of the inputs
Get the signature of the outputs
prep_task
(conf_frame, inputs)Define how one FP task is prepared.
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- execute(ip: OPIO) OPIO [source]
Execute the OP.
- Parameters:
- ipdict
Input dict with components:
config : (dict) Should have config[‘inputs’], which defines the input files of the FP task.
confs : (Artifact(List[Path])) Configurations for the FP tasks. Stored in folders as deepmd/npy format. Can be parsed as dpdata.MultiSystems.
- Returns:
- opdict
Output dict with components:
task_names: (List[str]) The name of tasks. Will be used as the identities of the tasks. The names of different tasks are different.
task_paths: (Artifact(List[Path])) The parepared working paths of the tasks. Contains all input files needed to start the FP. The order fo the Paths should be consistent with op[“task_names”]
- abstract prep_task(conf_frame: System, inputs: Any)[source]
Define how one FP task is prepared.
- Parameters:
- conf_framedpdata.System
One frame of configuration in the dpdata format.
- inputsAny
The class object handels all other input files of the task. For example, pseudopotential file, k-point file and so on.
dpgen2.fp.run_fp module
- class dpgen2.fp.run_fp.RunFp(*args, **kwargs)[source]
-
Execute a first-principles (FP) task.
A working directory named task_name is created. All input files are copied or symbol linked to directory task_name. The FP command is exectuted from directory task_name. The op[“labeled_data”] in “deepmd/npy” format (HF5 in the future) provided by dpdata will be created.
- Attributes:
- key
- workflow_name
Methods
args
()The argument definition of the run_task method.
execute
(ip)Execute the OP.
Get the signature of the inputs
Get the signature of the outputs
The mandatory input files to run a FP task.
normalize_config
([data, strict])Normalized the argument.
The optional input files to run a FP task.
run_task
(**kwargs)Defines how one FP task runs
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- abstract static args() List[Argument] [source]
The argument definition of the run_task method.
- Returns:
- arguments: List[dargs.Argument]
List of dargs.Argument defines the arguments of run_task method.
- execute(ip: OPIO) OPIO [source]
Execute the OP.
- Parameters:
- ipdict
Input dict with components:
config: (dict) The config of FP task. Should have config[‘run’], which defines the runtime configuration of the FP task.
task_name: (str) The name of task.
task_path: (Artifact(Path)) The path that contains all input files prepareed by PrepFp.
- Returns:
- Output dict with components:
- log: (Artifact(Path)) The log file of FP.
- labeled_data: (Artifact(Path)) The path to the labeled data in “deepmd/npy” format provided by dpdata.
- Raises:
- TransientError
On the failure of FP execution.
- FatalError
When mandatory files are not found.
- abstract input_files() List[str] [source]
The mandatory input files to run a FP task.
- Returns:
- files: List[str]
A list of madatory input files names.
- classmethod normalize_config(data: Dict = {}, strict: bool = True) Dict [source]
Normalized the argument.
- Parameters:
- dataDict
The input dict of arguments.
- strictbool
Strictly check the arguments.
- Returns:
- data: Dict
The normalized arguments.
- abstract optional_input_files() List[str] [source]
The optional input files to run a FP task.
- Returns:
- files: List[str]
A list of optional input files names.
- abstract run_task(**kwargs) Tuple[str, str] [source]
Defines how one FP task runs
- Parameters:
- **kwargs
Keyword args defined by the developer. The fp/run_config session of the input file will be passed to this function.
- Returns:
- out_name: str
The file name of the output data. Should be in dpdata.LabeledSystem format.
- log_name: str
The file name of the log.
dpgen2.fp.vasp module
- class dpgen2.fp.vasp.PrepVasp(*args, **kwargs)[source]
Bases:
PrepFp
- Attributes:
- key
- workflow_name
Methods
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
prep_task
(conf_frame, vasp_inputs)Define how one Vasp task is prepared.
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- prep_task(conf_frame: System, vasp_inputs: VaspInputs)[source]
Define how one Vasp task is prepared.
- Parameters:
- conf_framedpdata.System
One frame of configuration in the dpdata format.
- vasp_inputsVaspInputs
The VaspInputs object handels all other input files of the task.
- class dpgen2.fp.vasp.RunVasp(*args, **kwargs)[source]
Bases:
RunFp
- Attributes:
- key
- workflow_name
Methods
args
()The argument definition of the run_task method.
execute
(ip)Execute the OP.
get_input_sign
()Get the signature of the inputs
get_output_sign
()Get the signature of the outputs
The mandatory input files to run a vasp task.
normalize_config
([data, strict])Normalized the argument.
The optional input files to run a vasp task.
run_task
(command, out, log)Defines how one FP task runs
exec_sign_check
function
get_info
get_input_artifact_link
get_input_artifact_storage_key
get_opio_info
get_output_artifact_link
get_output_artifact_storage_key
register_output_artifact
- static args()[source]
The argument definition of the run_task method.
- Returns:
- arguments: List[dargs.Argument]
List of dargs.Argument defines the arguments of run_task method.
- input_files() List[str] [source]
The mandatory input files to run a vasp task.
- Returns:
- files: List[str]
A list of madatory input files names.
- optional_input_files() List[str] [source]
The optional input files to run a vasp task.
- Returns:
- files: List[str]
A list of optional input files names.
- run_task(command: str, out: str, log: str) Tuple[str, str] [source]
Defines how one FP task runs
- Parameters:
- commandstr
The command of running vasp task
- outstr
The name of the output data file.
- logstr
The name of the log file
- Returns:
- out_name: str
The file name of the output data in the dpdata.LabeledSystem format.
- log_name: str
The file name of the log.
dpgen2.fp.vasp_input module
- class dpgen2.fp.vasp_input.VaspInputs(kspacing: Union[float, List[float]], incar: str, pp_files: Dict[str, str], kgamma: bool = True)[source]
Bases:
object
- Attributes:
- incar_template
- potcars
Methods
args
incar_from_file
make_kpoints
make_potcar
normalize_config
potcars_from_file
- property incar_template
- property potcars