ForceBalanceOptimizer
- class openff.bespokefit.optimizers.forcebalance.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.
Internal method to get the registered targets for this specific optimizer.
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.
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.
- 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 get_registered_targets() Dict[str, Type[BaseTargetSchema]]
Internal method to get the registered targets for this specific optimizer.
- 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 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.