Commit 60307def authored by peastman's avatar peastman
Browse files

Merge pull request #59 from rmcgibbo/enumrepr

Add __repr__ to app's enums, so that we can print them easily
parents 0190d1e9 9a5ecd8f
...@@ -41,10 +41,25 @@ import simtk.openmm as mm ...@@ -41,10 +41,25 @@ import simtk.openmm as mm
# Enumerated values for implicit solvent model # Enumerated values for implicit solvent model
HCT = object() class HCT(object):
OBC1 = object() def __repr__(self):
OBC2 = object() return 'HCT'
GBn = object() HCT = HCT()
class OBC1(object):
def __repr__(self):
return 'OBC1'
OBC1 = OBC1()
class OBC2(object):
def __repr__(self):
return 'OBC2'
OBC2 = OBC2()
class GBn(object):
def __repr__(self):
return 'GBn'
GBn = GBn()
class AmberPrmtopFile(object): class AmberPrmtopFile(object):
"""AmberPrmtopFile parses an AMBER prmtop file and constructs a Topology and (optionally) an OpenMM System from it.""" """AmberPrmtopFile parses an AMBER prmtop file and constructs a Topology and (optionally) an OpenMM System from it."""
......
...@@ -42,17 +42,47 @@ from simtk.openmm.app import Topology ...@@ -42,17 +42,47 @@ from simtk.openmm.app import Topology
# Enumerated values for nonbonded method # Enumerated values for nonbonded method
NoCutoff = object() class NoCutoff(object):
CutoffNonPeriodic = object() def __repr__(self):
CutoffPeriodic = object() return 'NoCutoff'
Ewald = object() NoCutoff = NoCutoff()
PME = object()
class CutoffNonPeriodic(object):
def __repr__(self):
return 'CutoffNonPeriodic'
CutoffNonPeriodic = CutoffNonPeriodic()
class CutoffPeriodic(object):
def __repr__(self):
return 'CutoffPeriodic'
CutoffPeriodic = CutoffPeriodic()
class Ewald(object):
def __repr__(self):
return 'Ewald'
Ewald = Ewald()
class PME(object):
def __repr__(self):
return 'PME'
PME = PME()
# Enumerated values for constraint type # Enumerated values for constraint type
HBonds = object() class HBonds(object):
AllBonds = object() def __repr__(self):
HAngles = object() return 'HBonds'
HBonds = HBonds()
class AllBonds(object):
def __repr__(self):
return 'AllBonds'
AllBonds = AllBonds()
class HAngles(object):
def __repr__(self):
return 'HAngles'
HAngles = HAngles()
# A map of functions to parse elements of the XML file. # A map of functions to parse elements of the XML file.
......
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