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_cont(templates: list, revisions: dict)[source]
make_task() ExplorationTaskGroup[source]
set_lmp(numb_models: int, lmp_template_fname: str, plm_template_fname: Optional[str] = None, revisions: dict = {}, traj_freq: int = 10) None[source]
dpgen2.exploration.task.lmp_template_task_group.find_only_one_key(lmp_lines, key)[source]
dpgen2.exploration.task.lmp_template_task_group.revise_by_keys(lmp_lines, keys, values)[source]
dpgen2.exploration.task.lmp_template_task_group.revise_lmp_input_dump(lmp_lines, trj_freq)[source]
dpgen2.exploration.task.lmp_template_task_group.revise_lmp_input_model(lmp_lines, task_model_list, trj_freq, deepmd_version='1')[source]
dpgen2.exploration.task.lmp_template_task_group.revise_lmp_input_plm(lmp_lines, in_plm, out_plm='output.plumed')[source]

dpgen2.exploration.task.make_task_group_from_config module

dpgen2.exploration.task.make_task_group_from_config.lmp_template_task_group_args()[source]
dpgen2.exploration.task.make_task_group_from_config.make_task_group_from_config(numb_models, mass_map, config)[source]
dpgen2.exploration.task.make_task_group_from_config.normalize(data)[source]
dpgen2.exploration.task.make_task_group_from_config.npt_task_group_args()[source]
dpgen2.exploration.task.make_task_group_from_config.task_group_args()[source]
dpgen2.exploration.task.make_task_group_from_config.variant_task_group()[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_task()

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_task()

Make the LAMMPS task group.

add_task_group(grp: ExplorationTaskGroup)[source]

Add an exploration group

Parameters
grp: ExplorationTaskGroup

The added exploration task group

clear()[source]

Clear all exploration 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.

add_file(fname: str, fcont: str)[source]

Add file to the task

Parameters
fnamestr

The name of the file

fcontstr

The content of the file.

files() Dict[source]

Get all files for the task.

Returns
filesdict

The dict storing all files for the task. The file name is a key of the dict, and the file content is the corresponding value.

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.

clear() None[source]
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