SmirnoffForceFieldSource¶
-
class
openff.evaluator.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_json
(file_path)Create this object from a JSON file.
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
([file_path, format])Creates a JSON representation of this class.
parse_json
(string_contents[, encoding])Parses a typed json string into the corresponding class structure.
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
-
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
-
classmethod
from_json
(file_path)¶ Create this object from a JSON file.
- Parameters
file_path (str) – The path to load the JSON from.
- Returns
The parsed class.
- Return type
cls
-
json
(file_path=None, format=False)¶ Creates a JSON representation of this class.
-