scine_puffin.utilities.reaction_transfer_helper

Classes

ReactionTransferHelper(react_job, properties)

A class that can transfer some properties from reactants to products after we found a reaction.

class scine_puffin.utilities.reaction_transfer_helper.ReactionTransferHelper(react_job: ReactJob, properties: db.Collection, alternative_component_map: List[int] | None = None)[source]

A class that can transfer some properties from reactants to products after we found a reaction.

static map_total_indices_to_split_structure_indices(total_indices: Set[int] | List[int], component_map: List[int]) List[List[int]][source]

Maps the total indices to the split structure indices. This relies on the fact that component_map.apply keeps the order of indices within the new structures So we can infer the index in the new structure based on filling up

Parameters:
total_indicesList[int]

The total indices

component_mapList[int]

The component map specifying which total index belongs to which split structure

Returns:
List[List[int]]

The split structure indices

static simple_transfer(old_structure: db.Structure, new_structure: db.Structure, property_to_transfer: str) None

Transfer a single property from one structure to another.

Parameters:
old_structuredb.Structure

The structure holding the properties

new_structuredb.Structure

The structure receiving the properties

property_to_transferstr

The name of the property to transfer

static simple_transfer_all(old_structure: db.Structure, new_structure: db.Structure, properties: List[str]) None

Simply set the id of the given properties from one structure to another one

Parameters:
old_structuredb.Structure

The structure holding the properties

new_structuredb.Structure

The structure receiving the properties

propertiesList[str]

The names of the properties to transfer

slab_dict_name = 'slab_dict'
surface_indices_name = 'surface_atom_indices'
transfer_properties(old_structure: db.Structure, new_structure: db.Structure, properties_to_transfer: List[str]) None[source]

Transfer the given properties from one structure to another.

Parameters:
old_structuredb.Structure

Structure holding property

new_structuredb.Structure

Structure getting property

properties_to_transferList[str]

A list of names of the properties to transfer

transfer_properties_between_multiple(old_structures: List[db.Structure], new_structures: List[db.Structure], properties_to_transfer: List[str]) None[source]

Transfer properties between multiple structures to multiple other structures. This exists because some property transfers may require the knowledge of all reactants and all products.

Parameters:
old_structuresList[db.Structure]

The structures holding the properties

new_structuresList[db.Structure]

The structures receiving the properties

properties_to_transferList[str]

The names of the properties to transfer

Raises:
RuntimeError

The react job is missing a component map to map reactants to products.

NotImplementedError

Some unknown properties are requested for transferring