dpgen2.utils package
Submodules
dpgen2.utils.alloy_conf module
- class dpgen2.utils.alloy_conf.AlloyConf(lattice: Union[System, Tuple[str, float]], type_map: List[str], replicate: Optional[Union[List[int], Tuple[int], int]] = None)[source]
Bases:
object
- Parameters
- lattice Union[dpdata.System, Tuple[str,float]]
Lattice of the alloy confs. can be dpdata.System: lattice in dpdata.System Tuple[str, float]: pair of lattice type and lattice constant. lattice type can be “bcc”, “fcc”, “hcp”, “sc” or “diamond”
- replicate Union[List[int], Tuple[int], int]
replicate of the lattice
- type_map List[str]
The type map
Methods
generate_file_content
(numb_confs[, ...])- Parameters
generate_systems
(numb_confs[, ...])- Parameters
- generate_file_content(numb_confs, concentration: Optional[Union[List[List[float]], List[float]]] = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0, fmt: str = 'lammps/lmp') List[str] [source]
- Parameters
- numb_confs int
Number of configurations to generate
- concentration List[List[float]] or List[float] or None
If List[float], the concentrations of each element. The length of the list should be the same as the type_map. If List[List[float]], a list of concentrations (List[float]) is randomly picked from the List. If None, the elements are assumed to be of equal concentration.
- cell_pert_frac float
fraction of cell perturbation
- atom_pert_dist float
the atom perturbation distance (unit angstrom).
- fmt str
the format of the returned conf strings. Should be one of the formats supported by dpdata
- Returns
- conf_list List[str]
A list of file content of configurations.
- generate_systems(numb_confs, concentration: Optional[Union[List[List[float]], List[float]]] = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0) List[str] [source]
- Parameters
- numb_confs int
Number of configurations to generate
- concentration List[List[float]] or List[float] or None
If List[float], the concentrations of each element. The length of the list should be the same as the type_map. If List[List[float]], a list of concentrations (List[float]) is randomly picked from the List. If None, the elements are assumed to be of equal concentration.
- cell_pert_frac float
fraction of cell perturbation
- atom_pert_dist float
the atom perturbation distance (unit angstrom).
- Returns
- conf_list List[dpdata.System]
A list of generated confs in dpdata.System.
- dpgen2.utils.alloy_conf.generate_alloy_conf_file_content(lattice: Union[System, Tuple[str, float]], type_map: List[str], numb_confs, replicate: Optional[Union[List[int], Tuple[int], int]] = None, concentration: Optional[Union[List[List[float]], List[float]]] = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0, fmt: str = 'lammps/lmp')[source]
dpgen2.utils.chdir module
dpgen2.utils.dflow_config module
dpgen2.utils.dflow_query module
- dpgen2.utils.dflow_query.find_slice_ranges(keys: List[str], sliced_subkey: str)[source]
find range of sliced OPs that matches the pattern ‘iter-[0-9]*–{sliced_subkey}-[0-9]*’
- dpgen2.utils.dflow_query.get_last_iteration(keys: List[str])[source]
get the index of the last iteraction from a list of step keys.
- dpgen2.utils.dflow_query.get_last_scheduler(wf: Any, keys: List[str])[source]
get the output Scheduler of the last successful iteration
- dpgen2.utils.dflow_query.matched_step_key(all_keys: List[str], step_keys: Optional[List[str]] = None)[source]
returns the keys in all_keys that matches any of the step_keys
dpgen2.utils.download_dpgen2_artifacts module
- class dpgen2.utils.download_dpgen2_artifacts.DownloadDefinition[source]
Bases:
object
Methods
add_def
add_input
add_output
- dpgen2.utils.download_dpgen2_artifacts.download_dpgen2_artifacts(wf, key, prefix=None)[source]
download the artifacts of a step. the key should be of format ‘iter-xxxxxx–subkey-of-step-xxxxxx’ the input and output artifacts will be downloaded to prefix/iter-xxxxxx/key-of-step/inputs/ and prefix/iter-xxxxxx/key-of-step/outputs/
the downloaded input and output artifacts of steps are defined by op_download_setting