SmirnoffForceFieldSource

class propertyestimator.forcefield.SmirnoffForceFieldSource(inner_xml=None)[source]

A wrapper around force fields based on the SMIRks Native Open Force Field (SMIRNOFF) specification.

__init__(inner_xml=None)[source]

Constructs a new SmirnoffForceFieldSource object

Parameters

inner_xml (str, optional) – A string containing the xml representation of the force field.

Methods

__init__([inner_xml])

Constructs a new SmirnoffForceFieldSource object

from_object(force_field)

Creates a new SmirnoffForceFieldSource from an existing ForceField object

from_path(file_path)

Creates a new SmirnoffForceFieldSource from the file path to a ForceField object.

json()

Creates a JSON representation of this class.

parse_json(string_contents[, encoding])

Parses a typed json string into the corresponding class structure.

to_force_field()

Returns the SMIRNOFF force field created from this source.

to_force_field()[source]

Returns the SMIRNOFF force field created from this source.

Returns

The created force field.

Return type

openforcefield.typing.engines.smirnoff.ForceField

classmethod from_object(force_field)[source]

Creates a new SmirnoffForceFieldSource from an existing ForceField object

Notes

All cosmetic attributes will be discarded.

Parameters

force_field (openforcefield.typing.engines.smirnoff.ForceField) – The existing force field.

Returns

The created object.

Return type

SmirnoffForceFieldSource

classmethod from_path(file_path)[source]

Creates a new SmirnoffForceFieldSource from the file path to a ForceField object.

Notes

All cosmetic attributes will be discarded.

Parameters

file_path (str) – The file path to the force field object. This may also be the name of a file which can be loaded via an entry point.

Returns

The created object.

Return type

SmirnoffForceFieldSource

json()

Creates a JSON representation of this class.

Returns

The JSON representation of this class.

Return type

str

classmethod parse_json(string_contents, encoding='utf8')

Parses a typed json string into the corresponding class structure.

Parameters
  • string_contents (str or bytes) – The typed json string.

  • encoding (str) – The encoding of the string_contents.

Returns

The parsed class.

Return type

Any