dpgen2.exploration.task package
Subpackages
Submodules
dpgen2.exploration.task.conf_sampling_task_group module
- class dpgen2.exploration.task.conf_sampling_task_group.ConfSamplingTaskGroup[source]
Bases:
ExplorationTaskGroup
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
set_conf
(conf_list[, n_sample, random_sample])Set the configurations of exploration
clear
- set_conf(conf_list: List[str], n_sample: int | None = None, random_sample: bool = False)[source]
Set the configurations of exploration
- Parameters:
- conf_list str
A list of file contents
- n_sample int
Number of samples drawn from the conf list each time make_task is called. If set to None, n_sample is set to length of the conf_list.
- random_sample bool
If true the confs are randomly sampled, otherwise are consecutively sampled from the conf_list
dpgen2.exploration.task.customized_lmp_template_task_group module
- class dpgen2.exploration.task.customized_lmp_template_task_group.CustomizedLmpTemplateTaskGroup[source]
Bases:
ConfSamplingTaskGroup
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
set_conf
(conf_list[, n_sample, random_sample])Set the configurations of exploration
set_lmp
(numb_models, custom_shell_commands)Set lammps task.
clear
make_task
- make_task() ExplorationTaskGroup [source]
- set_lmp(numb_models: int, custom_shell_commands: List[str], revisions: dict = {}, traj_freq: int = 10, input_lmp_conf_name: str = 'conf.lmp', input_lmp_tmpl_name: str = 'in.lammps', input_plm_tmpl_name: str | None = None, input_extra_files: List[str] = [], output_dir_pattern: str | List[str] = '*', output_lmp_conf_name: str = 'conf.lmp', output_lmp_tmpl_name: str = 'in.lammps', output_plm_tmpl_name: str | None = None) None [source]
Set lammps task.
- Parameters:
- numb_modelsint
Number of models
- custom_shell_commandsstr
Customized shell commands to be run for each configuration. The commands require input_lmp_conf_name as input conf file, input_lmp_tmpl_name and input_plm_tmpl_name as templates, and input_extra_files as extra input files. By running the commands a series folders in pattern output_dir_pattern are supposed to be generated, and each folder is supposed to contain a configuration file output_lmp_conf_name, a lammps template file output_lmp_tmpl_name and a plumed template file output_plm_tmpl_name.
- revisionsdict
Revision dictionary. Provided in {key: [enumerated values]} format
- traj_freqint
Frequency along trajectory of checking model deviation
- input_lmp_conf_namestr
Input conf file name for the shell commands.
- input_lmp_tmpl_namestr
Template file name of lammps input
- input_plm_tmpl_namestr
Template file name of the plumed input
- input_extra_filesList[str]
Extra files that may be needed to execute the shell commands
- output_dir_patternUnion[str, List[str]]
Pattern of resultant folders generated by the shell commands.
- output_lmp_conf_namestr
Generated conf file name.
- output_lmp_tmpl_namestr
Generated lmp input file name.
- output_plm_tmpl_namestr
Generated plm input file name.
dpgen2.exploration.task.lmp_template_task_group module
- class dpgen2.exploration.task.lmp_template_task_group.LmpTemplateTaskGroup[source]
Bases:
ConfSamplingTaskGroup
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
set_conf
(conf_list[, n_sample, random_sample])Set the configurations of exploration
clear
make_cont
make_task
set_lmp
- make_task() ExplorationTaskGroup [source]
dpgen2.exploration.task.make_task_group_from_config module
- dpgen2.exploration.task.make_task_group_from_config.customized_lmp_template_task_group_args()[source]
dpgen2.exploration.task.npt_task_group module
- class dpgen2.exploration.task.npt_task_group.NPTTaskGroup[source]
Bases:
ConfSamplingTaskGroup
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
Make the LAMMPS task group.
set_conf
(conf_list[, n_sample, random_sample])Set the configurations of exploration
set_md
(numb_models, mass_map, temps[, ...])Set MD parameters
clear
- make_task() ExplorationTaskGroup [source]
Make the LAMMPS task group.
- Returns:
- task_grp: ExplorationTaskGroup
The returned lammps task group. The number of tasks is nconf*nT*nP. nconf is set by n_sample parameter of set_conf. nT and nP are lengths of the temps and press parameters of set_md.
- set_md(numb_models, mass_map, temps: List[float], press: List[float] | None = None, ens: str = 'npt', dt: float = 0.001, nsteps: int = 1000, trj_freq: int = 10, tau_t: float = 0.1, tau_p: float = 0.5, pka_e: float | None = None, neidelay: int | None = None, no_pbc: bool = False, use_clusters: bool = False, relative_f_epsilon: float | None = None, relative_v_epsilon: float | None = None, ele_temp_f: float | None = None, ele_temp_a: float | None = None)[source]
Set MD parameters
dpgen2.exploration.task.stage module
- class dpgen2.exploration.task.stage.ExplorationStage[source]
Bases:
object
The exploration stage.
Methods
add_task_group
(grp)Add an exploration group
clear
()Clear all exploration group.
Make the LAMMPS task group.
- add_task_group(grp: ExplorationTaskGroup)[source]
Add an exploration group
- Parameters:
- grpExplorationTaskGroup
The added exploration task group
- make_task() ExplorationTaskGroup [source]
Make the LAMMPS task group.
- Returns:
- task_grp: ExplorationTaskGroup
The returned lammps task group. The number of tasks is equal to the summation of task groups defined by all the exploration groups added to the stage.
dpgen2.exploration.task.task module
- class dpgen2.exploration.task.task.ExplorationTask[source]
Bases:
object
Define the files needed by an exploration task.
Examples
>>> # this example dumps all files needed by the task. >>> files = exploration_task.files() ... for file_name, file_content in files.items(): ... with open(file_name, 'w') as fp: ... fp.write(file_content)
Methods
add_file
(fname, fcont)Add file to the task
files
()Get all files for the task.
- class dpgen2.exploration.task.task.ExplorationTaskGroup[source]
Bases:
Sequence
A group of exploration tasks. Implemented as a list of ExplorationTask.
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
clear
- add_group(group: ExplorationTaskGroup)[source]
Add another group to the group.
- add_task(task: ExplorationTask)[source]
Add one task to the group.
- property task_list: List[ExplorationTask]
Get the list of ExplorationTask
- class dpgen2.exploration.task.task.FooTask(conf_name='conf.lmp', conf_cont='', inpu_name='in.lammps', inpu_cont='')[source]
Bases:
ExplorationTask
Methods
add_file
(fname, fcont)Add file to the task
files
()Get all files for the task.
- class dpgen2.exploration.task.task.FooTaskGroup(numb_task)[source]
Bases:
ExplorationTaskGroup
- Attributes:
task_list
Get the list of ExplorationTask
Methods
add_group
(group)Add another group to the group.
add_task
(task)Add one task to the group.
count
(value)index
(value, [start, [stop]])Raises ValueError if the value is not present.
clear
- property task_list
Get the list of ExplorationTask