Commit 1486a99d authored by Yutong Zhao's avatar Yutong Zhao
Browse files

Fixed deserializeState interface to take in a string (so it is consistent with...

Fixed deserializeState interface to take in a string (so it is consistent with that of deserializeSystem)
parent 6371f855
...@@ -259,9 +259,10 @@ Parameters: ...@@ -259,9 +259,10 @@ Parameters:
return buffer.str(); return buffer.str();
} }
static PyObject* _deserializeStringIntoLists(const std::string &filename) { static PyObject* _deserializeStringIntoLists(const std::string &stateAsString) {
std::fstream stateFile(filename.c_str(), std::ios::in); std::stringstream ss;
OpenMM::State* deserializedState = OpenMM::XmlSerializer::deserialize<OpenMM::State>(stateFile); ss << stateAsString;
OpenMM::State* deserializedState = OpenMM::XmlSerializer::deserialize<OpenMM::State>(ss);
PyObject* obj = _convertStateToLists(*deserializedState); PyObject* obj = _convertStateToLists(*deserializedState);
delete deserializedState; delete deserializedState;
return obj; return obj;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment