narupatools.openmm.serializer

More performant serialization and deserialization of OpenMM simulations.

Functions

deserialize_simulation

Deserialize an XML string to an OpenMM simulation.

serialize_simulation

Serialize an OpenMM simulation to an XML file.

narupatools.openmm.serializer.deserialize_simulation(contents: str)openmm.app.simulation.Simulation

Deserialize an XML string to an OpenMM simulation.

This is more performant than the equivalent method provided by Narupa, as it uses a faster XML library.

Parameters

contents – Contents of the XML file.

Returns

OpenMM simulation read from the provided string.

narupatools.openmm.serializer.serialize_simulation(simulation: openmm.app.simulation.Simulation)str

Serialize an OpenMM simulation to an XML file.

This is more performant than the equivalent method provided by Narupa, as it uses a faster XML library.

Parameters

simulation – OpenMM simulation to serialize.

Returns

String that contains XML serialized simulation.