openforcefield.typing.engines.smirnoff.io.XMLParameterIOHandler¶
-
class
openforcefield.typing.engines.smirnoff.io.
XMLParameterIOHandler
[source]¶ Handles serialization/deserialization of SMIRNOFF ForceField objects from OFFXML format.
Methods
parse_file
(source)Parse a SMIRNOFF force field definition in XML format, read from a file.
parse_string
(data)Parse a SMIRNOFF force field definition in XML format.
to_file
(file_path, smirnoff_data)Write the current forcefield parameter set to a file.
to_string
(smirnoff_data)Write the current forcefield parameter set to an XML string.
-
__init__
()¶ Create a new ParameterIOHandler.
Methods
__init__
()Create a new ParameterIOHandler.
parse_file
(source)Parse a SMIRNOFF force field definition in XML format, read from a file.
parse_string
(data)Parse a SMIRNOFF force field definition in XML format.
to_file
(file_path, smirnoff_data)Write the current forcefield parameter set to a file.
to_string
(smirnoff_data)Write the current forcefield parameter set to an XML string.
-
parse_file
(source)[source]¶ Parse a SMIRNOFF force field definition in XML format, read from a file.
- Parameters
- sourcestr or io.RawIOBase
File path of file-like object implementing a
read()
method specifying a SMIRNOFF force field definition in the SMIRNOFF XML format.
- Raises
- ParseError
If the XML cannot be processed.
- FileNotFoundError
If the file could not found.
-
parse_string
(data)[source]¶ Parse a SMIRNOFF force field definition in XML format.
A
ParseError
is raised if the XML cannot be processed.- Parameters
- datastr
A SMIRNOFF force field definition in the SMIRNOFF XML format.
-