Workchains#

Below are the primary workchains available in the module:

Main TrainsPot WorkChain
class aiida_trains_pot.aiida_trains_pot_workflow.aiida_trains_pot_workflow.TrainsPotWorkChain(*args: Any, **kwargs: Any)[source]#

WorkChain to launch LAMMPS calculations.

ab_initio_labelling()[source]#

Run ab_initio_labelling calculations.

dataset_augmentation()[source]#

Generate data for the dataset.

classmethod define(spec)[source]#

Specify inputs and outputs.

exploration()[source]#

Run exploration.

exploration_frame_extraction()[source]#

Run exploration frame extraction.

finalize_dataset_augmentation()[source]#

Finalize dataset augmentation.

classmethod get_builder(dataset, abinitiolabeling_code, md_code, training_code=None, abinitiolabeling_protocol=None, pseudo_family=None, md_protocol=None, **kwargs)[source]#

Return a builder prepopulated with inputs selected according to the chosen protocol.

Parameters:
  • dataset – The dataset to use for the calculation.

  • abinitiolabeling_protocol – The protocol to use for the ab initio labelling calculation.

  • abinitiolabeling_code – The code to use for the ab initio labelling calculation.

  • pseudo_family – The pseudo family to use for the calculation.

  • md_protocol – The protocol to use for the MD calculation.

  • kwargs – Additional keyword arguments to pass to the builder.

Returns:

A builder prepopulated with inputs selected according to the chosen protocol.

initialization()[source]#

Initialize variables.

training()[source]#

Run training calculations.

classmethod validate_inputs(inputs, namespace)[source]#

Validate the top-level inputs.

Dataset Augmentation WorkChain
class aiida_trains_pot.datasetaugmentation.datasetaugmentation_wc.datasetaugmentation_wc.DatasetAugmentationWorkChain(*args: Any, **kwargs: Any)[source]#

WorkChain to generate a training dataset.

check_inputs()[source]#

Check inputs.

classmethod define(spec)[source]#

Specify inputs and outputs.

classmethod get_builder_with_structures(structures)[source]#

Return a builder

replicate()[source]#

Replicate structures.

run_dataset_generation()[source]#

Generate datasets.

Ab Initio Labelling WorkChain
class aiida_trains_pot.aiida_trains_pot_workflow.abinitiolabelling_wc.AbInitioLabellingWorkChain(*args: Any, **kwargs: Any)[source]#

A workchain to loop over structures and submit AbInitioLabellingWorkChain.

check_labelled()[source]#

Check if all structures have been labelled.

classmethod define(spec)[source]#

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

run_ab_initio_labelling()[source]#

Run PwBaseWorkChain for each structure.

setup()[source]#

Initialize context and input parameters.

Training WorkChain
class aiida_trains_pot.aiida_trains_pot_workflow.training_wc.TrainingWorkChain(*args: Any, **kwargs: Any)[source]#

A workchain to loop over structures and submit MACEWorkChain.

classmethod define(spec)[source]#

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

run_training()[source]#

Run MACEWorkChain for each structure.

MD Exploration WorkChain
class aiida_trains_pot.aiida_trains_pot_workflow.exploration_wc.ExplorationWorkChain(*args: Any, **kwargs: Any)[source]#

A workchain to loop over structures and submit LammpsWorkChain with retries.

classmethod define(spec)[source]#

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

finalize_md()[source]#

Collect the results from the completed LAMMPS calculations.

not_converged()[source]#

Check if any calculation did not end successfully and requires a restart.

run_md()[source]#

Run MD simulations for each structure and MD parameter set, with retries on failure.

MACE Training WorkChain
class aiida_trains_pot.mace.mace_train_wc.mace_train_wc.MaceTrainWorkChain(*args: Any, **kwargs: Any)[source]#

WorkChain to launch MACE training.

classmethod define(spec)[source]#

Specify inputs and outputs.

handle_out_of_walltime(calculation)[source]#

Handle calculations where the walltime was reached.

The handler will try to find a configuration to restart from with the following priority

Use a stored restart file in the repository from the previous calculation.

report_error_handled(calculation, action)[source]#

Report an action taken for a calculation that has failed.

This should be called in a registered error handler if its condition is met and an action was taken. :param calculation: the failed calculation node :param action: a string message with the action taken

set_restart(calculation)[source]#

Set the parameters to run the restart calculation

Depending on the type of restart several variables of the input parameters will be changed to try to ensure that the calculation can resume from the last stored structure

Parameters:

calculation – node from the previous calculation

setup()[source]#

Call the setup of the BaseRestartWorkChain and create the inputs dictionary in self.ctx.inputs.

This self.ctx.inputs dictionary will be used by the BaseRestartWorkChain to submit the calculations in the internal loop.

The parameters and settings input Dict nodes are converted into a regular dictionary and the default namelists for the parameters are set to empty dictionaries if not specified.