openforcefield.typing.engines.smirnoff.parameters.ParameterType

class openforcefield.typing.engines.smirnoff.parameters.ParameterType(smirks=None, allow_cosmetic_attributes=False, **kwargs)[source]

Base class for SMIRNOFF parameter types.

Warning

This API is experimental and subject to change.

Attributes
smirks

Methods

add_cosmetic_attribute(self, attr_name, …)

Add a cosmetic attribute to this ParameterType object.

delete_cosmetic_attribute(self, attr_name)

Delete a cosmetic attribute from this ParameterType object.

to_dict(self[, discard_cosmetic_attributes])

Convert this ParameterType object to dict.

__init__(self, smirks=None, allow_cosmetic_attributes=False, **kwargs)[source]

Create a ParameterType

Parameters
smirksstr

The SMIRKS match for the provided parameter type.

allow_cosmetic_attributesbool optional. Default = False

Whether to permit non-spec kwargs (“cosmetic attributes”). If True, non-spec kwargs will be stored as an attribute of this parameter which can be accessed and written out. Otherwise an exception will be raised.

Methods

__init__(self[, smirks, …])

Create a ParameterType

add_cosmetic_attribute(self, attr_name, …)

Add a cosmetic attribute to this ParameterType object.

delete_cosmetic_attribute(self, attr_name)

Delete a cosmetic attribute from this ParameterType object.

to_dict(self[, discard_cosmetic_attributes])

Convert this ParameterType object to dict.

Attributes

smirks

to_dict(self, discard_cosmetic_attributes=False)[source]

Convert this ParameterType object to dict. A unit-bearing attribute (‘X’) will be converted to two dict entries, one ([‘X’] containing the unitless value, and another ([‘X_unit’]) containing a string representation of its unit.

Parameters
discard_cosmetic_attributesbool, optional. Default = False

Whether to discard non-spec attributes of this ParameterType

Returns
smirnoff_dictdict

The SMIRNOFF-compliant dict representation of this ParameterType object.

output_unitsdict[str: simtk.unit.Unit]

A mapping from each simtk.unit.Quanitity-valued ParameterType attribute to the unit it was converted to during serialization.

add_cosmetic_attribute(self, attr_name, attr_value)[source]

Add a cosmetic attribute to this ParameterType 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.

Parameters
attr_namestr

Name of the attribute to define for this ParameterType object.

attr_valuestr

The value of the attribute to define for this ParameterType object.

delete_cosmetic_attribute(self, attr_name)[source]

Delete a cosmetic attribute from this ParameterType object.

Parameters
attr_namestr

Name of the attribute to delete.