ForceBalanceOptimizer

class openff.bespokefit.optimizers.ForceBalanceOptimizer[source]

Bases: BaseOptimizer

An optimizer class which controls the interface with ForceBalance.

Methods

__init__()

deregister_target(target_name)

Remove a registered target from the optimizer.

description()

get_registered_targets()

Internal method to get the registered targets for this specific optimizer.

is_available()

name()

optimize(schema, initial_force_field[, ...])

This is the main function of the optimizer which is called when the optimizer is put in a workflow.

prepare(schema, initial_force_field, ...)

Prepares the optimization by creating any required inputs and setting up the required environment.

provenance()

Collect the provenance information for forcebalance.

register_target(target_type[, replace])

Take a target and register it with the optimizer under an alias name which is used to call the target.

__init__()
classmethod deregister_target(target_name: str)

Remove a registered target from the optimizer.

Parameters

target_name (str) – The name of the target that should be removed.

Raises

TargetRegisterError – If no target is registered under the name to be removed.

classmethod description() str[source]
classmethod get_registered_targets() Dict[str, Type[BaseTargetSchema]]

Internal method to get the registered targets for this specific optimizer.

classmethod is_available() bool[source]
classmethod name() str[source]
classmethod optimize(schema: OptimizationStageSchema, initial_force_field: ForceField, root_directory: Optional[str] = None) OptimizationStageResults

This is the main function of the optimizer which is called when the optimizer is put in a workflow.

It should loop over the targets and assert they are registered and then dispatch compute and optimization.

classmethod prepare(schema: OptimizationStageSchema, initial_force_field: ForceField, root_directory: str)

Prepares the optimization by creating any required inputs and setting up the required environment.

classmethod provenance() Dict[source]

Collect the provenance information for forcebalance.

classmethod register_target(target_type: Type[BaseTargetSchema], replace: bool = False) None

Take a target and register it with the optimizer under an alias name which is used to call the target.

Parameters
  • target_type – The type of target to be registered with the optimizer.

  • replace – If the alias is already registered replaced with the new target data with no exception.

Raises

TargetRegisterError – If the target has already been registered.

classmethod name() str[source]
classmethod description() str[source]
classmethod provenance() Dict[source]

Collect the provenance information for forcebalance.

classmethod is_available() bool[source]