Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
mrdna
Commits
d00d4bcf
Commit
d00d4bcf
authored
4 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrdna/arbdmodel/__init__.py
+6
-1
6 additions, 1 deletion
mrdna/arbdmodel/__init__.py
with
6 additions
and
1 deletion
mrdna/arbdmodel/__init__.py
+
6
−
1
View file @
d00d4bcf
...
...
@@ -341,7 +341,12 @@ class ParticleType():
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
"""
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
.
parent
=
parent
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment