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
# Enumerated values for implicit solvent model
HCT = object()
OBC1 = object()
OBC2 = object()
GBn = object()
class HCT(object):
def __repr__(self):
return 'HCT'
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):
"""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
# Enumerated values for nonbonded method
NoCutoff = object()
CutoffNonPeriodic = object()
CutoffPeriodic = object()
Ewald = object()
PME = object()
class NoCutoff(object):
def __repr__(self):
return 'NoCutoff'
NoCutoff = NoCutoff()
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
HBonds = object()
AllBonds = object()
HAngles = object()
class HBonds(object):
def __repr__(self):
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.
......
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