openforcefield.typing.engines.smirnoff.parameters.
ParameterHandler
(allow_cosmetic_attributes=False, skip_version_check=False, **kwargs)[source]¶Base class for parameter handlers.
Parameter handlers are configured with some global parameters for a given section. They may also contain a
ParameterList
populated with ParameterType
objects if they are responsile for assigning
SMIRKS-based parameters.
Warning
This API is experimental and subject to change.
known_kwargs
List of kwargs that can be parsed by the function.
parameters
The ParameterList that holds this ParameterHandler’s parameter objects
Methods
|
Add a cosmetic attribute to this ParameterHandler object. |
|
Add a parameter to the forcefield, ensuring all parameters are valid. |
|
Assign parameters for the given Topology to the specified System object. |
|
Checks if a set of kwargs used to create a ParameterHandler are compatible with this ParameterHandler. |
|
Check to make sure that the fields requiring defined units are compatible with the required units for the Parameters handled by this ParameterHandler |
|
Delete a cosmetic attribute from this ParameterHandler object. |
|
Find the elements of the topology/molecule matched by a parameter type. |
|
Return the parameters in this ParameterHandler that match the parameter_attrs argument |
|
Allow the force to perform a a final post-processing pass on the System following parameter assignment, if needed. |
|
Convert this ParameterHandler to an OrderedDict, compliant with the SMIRNOFF data spec. |
__init__
(self, allow_cosmetic_attributes=False, skip_version_check=False, **kwargs)[source]¶Initialize a ParameterHandler, optionally with a list of parameters and other kwargs.
Whether to permit non-spec kwargs. If True, non-spec kwargs will be stored as attributes of this object and can be accessed and modified. Otherwise an exception will be raised if a non-spec kwarg is encountered.
If False, the SMIRNOFF section version will not be checked, and the ParameterHandler will be initialized with version set to _MAX_SUPPORTED_SECTION_VERSION.
The dict representation of the SMIRNOFF data source
Methods
|
Initialize a ParameterHandler, optionally with a list of parameters and other kwargs. |
|
Add a cosmetic attribute to this ParameterHandler object. |
|
Add a parameter to the forcefield, ensuring all parameters are valid. |
|
Assign parameters for the given Topology to the specified System object. |
|
Checks if a set of kwargs used to create a ParameterHandler are compatible with this ParameterHandler. |
|
Check to make sure that the fields requiring defined units are compatible with the required units for the Parameters handled by this ParameterHandler |
|
Delete a cosmetic attribute from this ParameterHandler object. |
|
Find the elements of the topology/molecule matched by a parameter type. |
|
Return the parameters in this ParameterHandler that match the parameter_attrs argument |
|
Allow the force to perform a a final post-processing pass on the System following parameter assignment, if needed. |
|
Convert this ParameterHandler to an OrderedDict, compliant with the SMIRNOFF data spec. |
Attributes
List of kwargs that can be parsed by the function. |
|
The ParameterList that holds this ParameterHandler’s parameter objects |
parameters
¶The ParameterList that holds this ParameterHandler’s parameter objects
add_cosmetic_attribute
(self, attr_name, attr_value)[source]¶Add a cosmetic attribute to this ParameterHandler object. This attribute will not have a functional effect on the object in the Open Force Field toolkit, but can be written out during output.
Name of the attribute to define for this ParameterType object.
The value of the attribute to define for this ParameterType object.
delete_cosmetic_attribute
(self, attr_name)[source]¶Delete a cosmetic attribute from this ParameterHandler object.
Name of the attribute to delete.
known_kwargs
¶List of kwargs that can be parsed by the function.
check_parameter_compatibility
(self, parameter_kwargs)[source]¶Check to make sure that the fields requiring defined units are compatible with the required units for the Parameters handled by this ParameterHandler
The dict that will be used to construct the ParameterType
check_handler_compatibility
(self, handler_kwargs)[source]¶Checks if a set of kwargs used to create a ParameterHandler are compatible with this ParameterHandler. This is called if a second handler is attempted to be initialized for the same tag.
The kwargs that would be used to construct
add_parameter
(self, parameter_kwargs)[source]¶Add a parameter to the forcefield, ensuring all parameters are valid.
The kwargs to pass to the ParameterHandler.INFOTYPE (a ParameterType) constructor
get_parameter
(self, parameter_attrs)[source]¶Return the parameters in this ParameterHandler that match the parameter_attrs argument
The attrs mapped to desired values (for example {“smirks”: “[:1]~[#16:2]=,:[#6:3]~[:4]”, “id”: “t105”} )
A list of matching ParameterType objects
find_matches
(self, entity)[source]¶Find the elements of the topology/molecule matched by a parameter type.
Topology to search.
matches[particle_indices]
is the ParameterType
object
matching the tuple of particle indices in entity
.
assign_parameters
(self, topology, system)[source]¶Assign parameters for the given Topology to the specified System object.
The Topology for which parameters are to be assigned. Either a new Force will be created or parameters will be appended to an existing Force.
The OpenMM System object to add the Force (or append new parameters) to.
postprocess_system
(self, topology, system, **kwargs)[source]¶Allow the force to perform a a final post-processing pass on the System following parameter assignment, if needed.
The Topology for which parameters are to be assigned. Either a new Force will be created or parameters will be appended to an existing Force.
The OpenMM System object to add the Force (or append new parameters) to.
to_dict
(self, discard_cosmetic_attributes=False)[source]¶Convert this ParameterHandler to an OrderedDict, compliant with the SMIRNOFF data spec.
Whether to discard non-spec parameter and header attributes in this ParameterHandler.
SMIRNOFF-spec compliant representation of this ParameterHandler and its internal ParameterList.