Commit 01ae387d authored by xantares's avatar xantares
Browse files

fix swig build

parent 7b67c27b
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
} }
%pythoncode { %pythoncode %{
def getState(self, def getState(self,
getPositions=False, getPositions=False,
getVelocities=False, getVelocities=False,
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
if state._paramMap is not None: if state._paramMap is not None:
for param in state._paramMap: for param in state._paramMap:
self.setParameter(param, state._paramMap[param]) self.setParameter(param, state._paramMap[param])
} %}
%feature("docstring") createCheckpoint "Create a checkpoint recording the current state of the Context. %feature("docstring") createCheckpoint "Create a checkpoint recording the current state of the Context.
This should be treated as an opaque block of binary data. See loadCheckpoint() for more details. This should be treated as an opaque block of binary data. See loadCheckpoint() for more details.
...@@ -175,7 +175,7 @@ Parameters: ...@@ -175,7 +175,7 @@ Parameters:
} }
%pythoncode { %pythoncode %{
def getState(self, def getState(self,
copy, copy,
getPositions=False, getPositions=False,
...@@ -235,11 +235,11 @@ Parameters: ...@@ -235,11 +235,11 @@ Parameters:
periodicBoxVectorsList=periodicBoxVectorsList, periodicBoxVectorsList=periodicBoxVectorsList,
paramMap=paramMap) paramMap=paramMap)
return state return state
} %}
} }
%extend OpenMM::NonbondedForce { %extend OpenMM::NonbondedForce {
%pythoncode { %pythoncode %{
def addParticle_usingRVdw(self, charge, rVDW, epsilon): def addParticle_usingRVdw(self, charge, rVDW, epsilon):
"""Add particle using elemetrary charge. Rvdw and epsilon, """Add particle using elemetrary charge. Rvdw and epsilon,
which is consistent with AMBER parameter file usage. which is consistent with AMBER parameter file usage.
...@@ -260,11 +260,11 @@ Parameters: ...@@ -260,11 +260,11 @@ Parameters:
""" """
return self.addException(particle1, particle2, return self.addException(particle1, particle2,
chargeProd, rMin/RMIN_PER_SIGMA, epsilon) chargeProd, rMin/RMIN_PER_SIGMA, epsilon)
} %}
} }
%extend OpenMM::System { %extend OpenMM::System {
%pythoncode { %pythoncode %{
def __getstate__(self): def __getstate__(self):
serializationString = XmlSerializer.serializeSystem(self) serializationString = XmlSerializer.serializeSystem(self)
return serializationString return serializationString
...@@ -275,7 +275,7 @@ Parameters: ...@@ -275,7 +275,7 @@ Parameters:
def getForces(self): def getForces(self):
"""Get the list of Forces in this System""" """Get the list of Forces in this System"""
return [self.getForce(i) for i in range(self.getNumForces())] return [self.getForce(i) for i in range(self.getNumForces())]
} %}
} }
%extend OpenMM::XmlSerializer { %extend OpenMM::XmlSerializer {
...@@ -345,7 +345,7 @@ Parameters: ...@@ -345,7 +345,7 @@ Parameters:
return obj; return obj;
} }
%pythoncode { %pythoncode %{
@staticmethod @staticmethod
def _serializeState(pythonState): def _serializeState(pythonState):
positions = [] positions = []
...@@ -431,7 +431,7 @@ Parameters: ...@@ -431,7 +431,7 @@ Parameters:
if type == "State": if type == "State":
return XmlSerializer._deserializeState(inputString) return XmlSerializer._deserializeState(inputString)
raise ValueError("Unsupported object type") raise ValueError("Unsupported object type")
} %}
} }
%extend OpenMM::CustomIntegrator { %extend OpenMM::CustomIntegrator {
...@@ -443,7 +443,7 @@ Parameters: ...@@ -443,7 +443,7 @@ Parameters:
} }
%extend OpenMM::Force { %extend OpenMM::Force {
%pythoncode { %pythoncode %{
def __copy__(self): def __copy__(self):
copy = self.__class__.__new__(self.__class__) copy = self.__class__.__new__(self.__class__)
copy.__init__(self) copy.__init__(self)
...@@ -451,11 +451,11 @@ Parameters: ...@@ -451,11 +451,11 @@ Parameters:
def __deepcopy__(self, memo): def __deepcopy__(self, memo):
return self.__copy__() return self.__copy__()
} %}
} }
%extend OpenMM::Integrator { %extend OpenMM::Integrator {
%pythoncode { %pythoncode %{
def __getstate__(self): def __getstate__(self):
serializationString = XmlSerializer.serialize(self) serializationString = XmlSerializer.serialize(self)
return serializationString return serializationString
...@@ -463,5 +463,5 @@ Parameters: ...@@ -463,5 +463,5 @@ Parameters:
def __setstate__(self, serializationString): def __setstate__(self, serializationString):
system = XmlSerializer.deserialize(serializationString) system = XmlSerializer.deserialize(serializationString)
self.this = system.this self.this = system.this
} %}
} }
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