openmmml.mlpotential.MLPotentialImplFactory#
- class openmmml.mlpotential.MLPotentialImplFactory#
Abstract interface for classes that create MLPotentialImpl objects.
If you are defining a new potential function, you need to create subclasses of MLPotentialImpl and MLPotentialImplFactory, and register an instance of the factory by calling MLPotential.registerImplFactory(). Alternatively, if a Python package creates an entry point in the group “openmmml.potentials”, the potential will be registered automatically. The entry point name is the name of the potential function, and the value should be the name of the MLPotentialImplFactory subclass.
- __init__()#
Methods
__init__
()createImpl
(name, **args)Create a MLPotentialImpl that will be used to implement a MLPotential.
- createImpl(name: str, **args) MLPotentialImpl #
Create a MLPotentialImpl that will be used to implement a MLPotential.
When a MLPotential is created, it invokes this method to create an object implementing the requested potential. Subclasses must implement this method to return an instance of the correct MLPotentialImpl subclass.
- Parameters:
name (str) – the name of the potential that was specified to the MLPotential constructor
args – any additional keyword arguments that were provided to the MLPotential constructor are passed to this method. This allows subclasses to customize their behavior based on extra arguments.
- Return type:
a MLPotentialImpl that implements the potential