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: Optional[int] = 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.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.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: Optional[List[float]] = 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: Optional[float] = None, neidelay: Optional[int] = None, no_pbc: bool = False, use_clusters: bool = False, relative_f_epsilon: Optional[float] = None, relative_v_epsilon: Optional[float] = None, ele_temp_f: Optional[float] = None, ele_temp_a: Optional[float] = 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
- grp: ExplorationTaskGroup
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