Skip to content
Snippets Groups Projects
Commit d00d4bcf authored by cmaffeo2's avatar cmaffeo2
Browse files

Added lazy lookup of attributes from parents for ParticleType objects

parent 1d5f21b8
No related branches found
No related tags found
No related merge requests found
...@@ -341,7 +341,12 @@ class ParticleType(): ...@@ -341,7 +341,12 @@ class ParticleType():
def __init__(self, name, charge=0, parent=None, **kargs): def __init__(self, name, charge=0, parent=None, **kargs):
""" Parent type is used to fall back on for nonbonded interactions if this type is not specifically referenced """ """ Parent type is used to fall back on for nonbonded interactions if this type is not specifically referenced """
self.name = name if parent is not None:
for k,v in parent.__dict__.items():
if k not in ParticleType.excludedAttributes:
self.__dict__[k] = v
self.name = name
self.charge = charge self.charge = charge
self.parent = parent self.parent = parent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment