ForceFieldEditor

class openff.bespokefit.utilities.smirnoff.ForceFieldEditor(force_field: Union[str, ForceField])[source]

Bases: object

Methods

__init__(force_field)

Parameters

force_field -- A path to a serialized SMIRNOFF force field or the

add_parameters(parameters)

Work out which type of smirks this is and add it to the forcefield, if this is not a bespoke parameter update the value in the forcefield.

get_initial_parameters(molecule, smirks)

Find the initial parameters assigned to the atoms in the given smirks patterns and update the values to match the force field.

get_parameters(molecule, atoms_by_type)

For a given molecule label it and get back the smirks patterns and parameters for the requested atoms.

label_molecule(molecule)

Type the molecule with the forcefield and return a molecule parameter dictionary.

__init__(force_field: Union[str, ForceField])[source]
Parameters

force_field – A path to a serialized SMIRNOFF force field or the contents of an OFFXML serialized SMIRNOFF force field.

Notes
  • This will always try to strip the constraints parameter handler as the FF should be unconstrained for fitting.

add_parameters(parameters: List[ParameterType]) List[ParameterType][source]

Work out which type of smirks this is and add it to the forcefield, if this is not a bespoke parameter update the value in the forcefield.

get_initial_parameters(molecule: Molecule, smirks: List[SMIRNOFFParameter]) List[ParameterType][source]

Find the initial parameters assigned to the atoms in the given smirks patterns and update the values to match the force field.

get_parameters(molecule: Molecule, atoms_by_type: Dict[str, List[Tuple[int, ...]]]) List[ParameterType][source]

For a given molecule label it and get back the smirks patterns and parameters for the requested atoms.

label_molecule(molecule: Molecule) Dict[str, Dict[Tuple[int, ...], ParameterType]][source]

Type the molecule with the forcefield and return a molecule parameter dictionary.

Parameters

molecule – The molecule that should be labeled by the force field.

Returns

A dictionary of each parameter assigned to molecule organised by parameter handler type.

add_parameters(parameters: List[ParameterType]) List[ParameterType][source]

Work out which type of smirks this is and add it to the forcefield, if this is not a bespoke parameter update the value in the forcefield.

label_molecule(molecule: Molecule) Dict[str, Dict[Tuple[int, ...], ParameterType]][source]

Type the molecule with the forcefield and return a molecule parameter dictionary.

Parameters

molecule – The molecule that should be labeled by the force field.

Returns

A dictionary of each parameter assigned to molecule organised by parameter handler type.

get_parameters(molecule: Molecule, atoms_by_type: Dict[str, List[Tuple[int, ...]]]) List[ParameterType][source]

For a given molecule label it and get back the smirks patterns and parameters for the requested atoms.

get_initial_parameters(molecule: Molecule, smirks: List[SMIRNOFFParameter]) List[ParameterType][source]

Find the initial parameters assigned to the atoms in the given smirks patterns and update the values to match the force field.